Custom Statement wont print on a certain customer file

We use a customised statement that includes a subreport with an invoice breakdown for those invoices processed in the current accounting period. 

 

The statement prints fine for almost all our debtors except 1.  This debtor has around 30 or so invoices this month.  Attempting to print an invoice gives the error

Failed to generate report: The subreport is placed on a non-splitting band, but it does not have a rewindable data source

I suspect the statement ends up with a page break at an area where the subreport falls.  

Any tips on resolving?

Ben

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: Custom Statement wont print on a certain customer file

Check to see if your report matches any of the criteria here: http://stackoverflow.com/questions/5129143/jasper-report-subreport-issue

-Tim

Re: Custom Statement wont print on a certain customer file

My report was the stadard Statement report with a subreport under each statement item which would break down the item categorised by patient.. works absolutely fine 99.9% of the time. interesing each statement item is over 2 lines (i added the "notes" field to the each line ...) 

However when I did the client merge last week and the monthly statement for that client was 50 or so pages long with about $40000 of invoices... what I assumed happened that luck made one of the subreports  hit a page break.  because the datasource is not rewindable ie it cant stop generating that entry go to a new page and start again it causes a error and fails..

In my case I simply squashed my statement reports fields up and fiddled with the lineheight a bit then retried the print.  Once it worked I ended the period and switched back to my old statement.

 

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Custom Statement wont print on a certain customer file

Just to be clear, you've customised the statementItems.jrxml to include its own sub-report? Is that sub-report in a detail band, or some other band?

Re: Custom Statement wont print on a certain customer file

Detail band.  - but I didnt add a subreport to statementitems - 

statementitems is a subreport of statement...the customization I added was to the statement template

I added the Invoice ID to each line and added the Invoice notes field to a the detail band but below the statement Items...this meant that it was more likely the detail loop MIGHT hit a pagebreak I guess.

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Custom Statement wont print on a certain customer file

This error is back haunting me again - the statements involved are big - multiple pages and the client prefers itemization on the statements so I need to sort it out.

Basically i think the error is that org.openvpms.reports.ImObjectCollectionsDataSource is non rewindable and if a print line falls on a page boundry the reporter needs to be able to rewind the datasource 1 line and print it on the next page.

I think we need to "upgrade" the DataSource to be rewindable.

http://www.openvpms.org/fisheye/browse/Openvpms/reports/trunk/src/java/org/openvpms/report/jasper/AbstractIMObjectDataSource.java?r=6342

public abstract class AbstractIMObjectDataSource implements JRDataSource

this could be changed I think to support JRRewindableDatasource instead

here is an example of a change 

https://fisheye6.atlassian.com/browse/struts2/trunk/plugins/jasperreport...

I will take a look and submit a patch.

 

 

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au
Syndicate content