Re: JasperReport LocalDate question
Re: JasperReport LocalDate question
- Subject: Re: JasperReport LocalDate question
- From: Theodore Petrosky <email@hidden>
- Date: Tue, 1 Feb 2011 15:18:42 -0800 (PST)
What I have finally come to the conclusion is that the problem is neither Joda nor WO but an iReport issue. Not a bug nor anything 'wrong'. I just need to learn iReport and how to tell it what I want.
For instance. there are two places one needs to tell iReport about the class definitions.
1. in the creation of the Field Variables. first you give it a name then the Field Class. In this case org.joda.time.LocalDate.
2. then you apply the Field variable to a Text Field. The Text Field has both a Text Field Expression and an Expression Class. This is where I am falling down. The Expression Class is not editable. You can only choose from the internal list of Classes. (java.util.Date, java.lang.String,…etc)
In the last email from Kieren(sp) he mentions some possibilities for applying class to the Field Variable. So I am in the process of reading as much as possible on iReport and JodaTime as well as looking at the methods available in LocalDart.
I think it is fantastic that Henrique's example allows me to use dates in my backend. That said, I guess I could add some accessors to my WO model that vend out NSTimestamp just for this. Then I am done.
I really wanted (and want) to learn how to use the JodaTime (LocalDate) in iReport.
Ted
--- On Tue, 2/1/11, Paul Hoadley <email@hidden> wrote:
> From: Paul Hoadley <email@hidden>
> Subject: Re: JasperReport LocalDate question
> To: "Theodore Petrosky" <email@hidden>
> Cc: "WebObjects-Dev Mailing List List" <email@hidden>
> Date: Tuesday, February 1, 2011, 5:35 PM
> With the caveat that I don't know
> anything about JR...
>
> On 02/02/2011, at 1:08 AM, Theodore Petrosky wrote:
>
> > I used the org.joda.time.LocalDate for the Field Class
> Definition.
>
> Don't you want to be using your wrapper class for
> LocalDate, not Joda's LocalDate? This name collision
> is unfortunate—when I borrowed the code from Henrique's
> sample project, I renamed the wrapper class to LSLocalDate
> to avoid just this confusion. It's the wrapper class
> that's in your model, and that is presumably being handed to
> JR.
>
> > I still get the compile time error that it can not
> cast from LocalDate to java.util.Date:
>
> Of course, that doesn't explain why JR is still trying to
> cast it to a Date. I just don't know enough to help
> there.
>
> > So I tried changing to an NSTimestamp to see if I
> installed the jars correctly and Voila. No compilation
> errors. So it looks like Joda LocalDate does not Extend
> java.util.Date.
>
> It certainly doesn't. Nor does your wrapper
> class. Nor should they.
>
> > We have entered the world of, "I have no idea where to
> go now".
>
> That's disappointing (mostly for you!), because the Joda
> LocalDate class works just fine as a custom attribute type,
> and solves exactly your original problem. I'm sorry I
> don't know enough about JR to help you integrate it there.
>
>
> --
> Paul.
>
> http://logicsquad.net/
>
>
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden