So I stopped guessing (or maybe bad guessing). Here is what I saw:

1. from my nslog: 

qualifier=(invoiceBookedDate =
> (com.webobjects.foundation.NSTimestamp)'2010-12-06 00:00:00
> Etc/GMT'),

I know this date is good. I was querying the postgresql db from psql with a 
select using that datestamp and I got rows of data. So i looked at the 
postgresql logs and I notice that the actual date passing into the query is:

'2010-12-05 00:00:00 Etc/GMT'

WT_???

So i didn't change anything but selected the next day in my app (in this case 
'2010-07-01..' and voila it worked as expected (I got good data and no error). 
And the date passed in the postgresql logs said the 6th.

so why was I doing this: 
theDate = theDate.timestampByAddingGregorianUnits(0, 0, 0, -5, 0, 0);

I did that because I kept seeing:

'2010-12-06 05:00:00 Etc/GMT'   in my logs and I knew I was only interested in 
the date (without timestamp) but I never figured out how to only pass around 
dates without timestamps and everything was working. I was subtracting the 5 
hours and I didn't need to. (and it was biting me in the backend.)

Postgresql supports dates without timestamp, I wish I knew how to do this in 
webobject java. (But still call them dates so I can do date math.)

So the error has nothing to do with my WOD. I am picking up the JasperReports 
example from the WOWODC 2010 videos. I guess the example has problems with a 
query returning no rows.

Now if I can only figure out how to pass an array from a previous query to 
JasperReports I would be happier. 

I have to go back to re-reading this plethora of documentation.

Thanks for your timely help.

Ted



--- On Tue, 1/25/11, Chuck Hill <ch...@global-village.net> wrote:

> From: Chuck Hill <ch...@global-village.net>
> Subject: Re: what am i doing wrong with this qualifier
> To: "Theodore Petrosky" <tedp...@yahoo.com>
> Cc: webobjects-dev@lists.apple.com
> Date: Tuesday, January 25, 2011, 6:35 PM
> Stop guessing.  Think. 
> :-)
> 
> > Jan 25 18:15:09 TheWorkTracker[63447] INFO 
> er.extensions.components._private.ERXWOString  -
> Exception while formatting
> > NumberFormatException: Infinite or NaN
> 
> Read that.  Again.  Again.
> 
> ... ERXWOString ...
> 
> This error is coming from a WOString binding in your wod
> file.
> 
> 
> Chuck
> 
> 
> On Jan 25, 2011, at 3:18 PM, Theodore Petrosky wrote:
> 
> > I just quit the app and relaunched:
> > Here is the full method:
> > 
> > public static Callable<File>
> createSingleDateReportTask(NSTimestamp theDate) {
> >     // SortOrderings
> >     // Sort by studio name alphabetical
> sort
> >     //ERXSortOrderings sortOrderings =
> User.LAST_NAME.ascs();
> > 
> >     ERXSortOrderings sortOrderings =
> Invoice.INVOICE_BOOKED_DATE.ascs();
> >         
> >     theDate =
> theDate.timestampByAddingGregorianUnits(0, 0, 0, -5, 0, 0);
> >         
> >    
> //Invoice.INVOICE_BOOKED_DATE.is(theDate)
> >     EOQualifier qualifier =
> ERXQ.is("invoiceBookedDate", theDate);
> >     //EOQualifier qualifier =
> null;       
>         
> >         
> >    
> ERXFetchSpecification<Invoice> fs = new
> ERXFetchSpecification<Invoice>(Invoice.ENTITY_NAME,
> qualifier, sortOrderings);
> >         
> >     NSLog.out.appendln("fs = " + fs);
> >         
> >     String reportDescription = "A
> report on Invoices booked on: " + theDate;
> >         
> >    
> NSLog.out.appendln("reportDescription = " +
> reportDescription);
> >     HashMap<String, Object>
> parameters = new HashMap<String, Object>();
> >     parameters.put("reportDescription",
> reportDescription);
> >     //parameters.put("userName",
> "WOWODC Demo");
> >         
> >     // Builder pattern for constructor
> since.
> >     ERJRFetchSpecificationReportTask
> reportTask = new ERJRFetchSpecificationReportTask(fs,
> "BillingToday.jasper", parameters);
> >         
> >     NSLog.out.appendln("reportTask " +
> reportTask);
> >         
> >     return reportTask;
> > }
> > 
> > here is the error:
> > if qualifier is null then there is no error and I get
> my report.
> > 
> > Jan 25 18:15:00 TheWorkTracker[63447] DEBUG
> NSLog  - Waiting for requests...
> > Jan 25 18:15:09 TheWorkTracker[63447] INFO 
> NSLog  - printReport singleDateCondition called
> > Jan 25 18:15:09 TheWorkTracker[63447] INFO 
> NSLog  - fs = <class
> er.extensions.eof.ERXFetchSpecification(entityName=Invoice,
> > qualifier=(invoiceBookedDate =
> (com.webobjects.foundation.NSTimestamp)'2010-12-06 00:00:00
> Etc/GMT'),
> > isDeep=true, usesDistinct=false,
> > sortOrdering=(<class
> er.extensions.eof.ERXSortOrdering(invoiceBookedDate
> compareAscending)>),
> > hints=null,
> > _prefetchingRelationshipKeyPaths = null)>
> > Jan 25 18:15:09 TheWorkTracker[63447] INFO 
> NSLog  - reportDescription = A report on Invoices
> booked on: 2010-12-06 00:00:00 Etc/GMT
> > Jan 25 18:15:09 TheWorkTracker[63447] INFO 
> NSLog  - reportTask
> er.jasperreports.ERJRFetchSpecificationReportTask@54aa39d6
> > Jan 25 18:15:09 TheWorkTracker[63447] INFO 
> er.jrexample.controllers.AbstractPageController  -
> Controller named
> 'er.jrexample.controllers.FileTaskDownloadController' just
> instantiated in page named
> 'com.eltek.components.TWTBilling_DailyReportComponent'
> > Jan 25 18:15:09 TheWorkTracker[63447] INFO 
> NSLog  - FileTaskDownloadController called
> > Jan 25 18:15:09 TheWorkTracker[63447] INFO 
> NSLog  - nextPageController called = Billing List
> > Jan 25 18:15:09 TheWorkTracker[63447] INFO 
> er.extensions.components._private.ERXWOString  -
> Exception while formatting
> > NumberFormatException: Infinite or NaN
> >  at
> java.math.BigDecimal.<init>(BigDecimal.java:797)
> >  at
> com.webobjects.foundation.NSNumberFormatter.stringForObjectValue(NSNumberFormatter.java:1026)
> >  at
> com.webobjects.foundation.NSNumberFormatter.format(NSNumberFormatter.java:1654)
> >  at
> er.extensions.formatters.ERXNumberFormatter.format(ERXNumberFormatter.java:250)
> >  at java.text.Format.format(Format.java:140)
> >  ... skipped 31 stack elements
> > Jan 25 18:15:11 TheWorkTracker[63447] INFO 
> er.extensions.components._private.ERXWOString  -
> Exception while formatting
> > NumberFormatException: Infinite or NaN
> >  at
> java.math.BigDecimal.<init>(BigDecimal.java:797)
> >  at
> com.webobjects.foundation.NSNumberFormatter.stringForObjectValue(NSNumberFormatter.java:1026)
> >  at
> com.webobjects.foundation.NSNumberFormatter.format(NSNumberFormatter.java:1654)
> >  at
> er.extensions.formatters.ERXNumberFormatter.format(ERXNumberFormatter.java:250)
> >  at java.text.Format.format(Format.java:140)
> >     ... skipped 8 stack elements
> >  at
> er.ajax.AjaxUpdateContainer.handleRequest(AjaxUpdateContainer.java:263)
> >     ... skipped 16 stack elements
> >  at
> er.ajax.AjaxRequestHandler.handleRequest(AjaxRequestHandler.java:17)
> >  ... skipped 6 stack elements
> > Jan 25 18:15:11 TheWorkTracker[63447] INFO 
> er.extensions.components._private.ERXWOString  -
> Exception while formatting
> > NumberFormatException: Infinite or NaN
> >  at
> java.math.BigDecimal.<init>(BigDecimal.java:797)
> >  at
> com.webobjects.foundation.NSNumberFormatter.stringForObjectValue(NSNumberFormatter.java:1026)
> >  at
> com.webobjects.foundation.NSNumberFormatter.format(NSNumberFormatter.java:1654)
> >  at
> er.extensions.formatters.ERXNumberFormatter.format(ERXNumberFormatter.java:250)
> >  at java.text.Format.format(Format.java:140)
> >     ... skipped 8 stack elements
> >  at
> er.ajax.AjaxUpdateContainer.handleRequest(AjaxUpdateContainer.java:263)
> >     ... skipped 16 stack elements
> >  at
> er.ajax.AjaxRequestHandler.handleRequest(AjaxRequestHandler.java:17)
> >  ... skipped 6 stack elements
> > nextPage action fired
> > 
> > 
> > 
> 
> -- 
> Chuck Hill         
>    Senior Consultant / VP Development
> 
> Practical WebObjects - for developers who want to increase
> their overall knowledge of WebObjects or who are trying to
> solve specific problems.    
> http://www.global-village.net/products/practical_webobjects
> 
> 
> 
> 
> 
> 
> 
> 



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to