2002 JI Open Discussion Posted August 18, 2006 Share Posted August 18, 2006 By: Peter Kohlendorfer - kohlendorfer Error with subreports? 2003-04-01 06:06 Hi, when using subreports the first row always gets dropped in my subreport. However, when displaying the subreport alone (not embedded) I see all rows. I am using the following subreport definition: <subreport isUsingCache="true"> <reportElement x="0" y="0" width="802" height="20" isPrintRepeatedValues="false" isPrintWhenDetailOverflows="false" isRemoveLineWhenBlank="true"/> <dataSourceExpression> $P{REPORT_DATA_SOURCE} </dataSourceExpression> <subreportExpression class="dori.jasper.engine.JasperReport"> $P{SubreportName} </subreportExpression> </subreport> Any ideas what could be wrong? Greetings, Peter By: Teodor Danciu - teodord RE: Error with subreports? 2003-04-01 10:00 Hi, You are passing to your subreport the same data source that the master reports has. This is not quite usual. If you are sure it is exactly what you need to do, note that when generating the subreport, the pointer in the datasource already points to the row let's say "n" and the first row appearing in the subreport will be the next, which is "n + 1". If you want the row "n" of the data source to appear in the subreport, you need a custom data source that will allow you to reverse the pointer in the data source with one position, before launching the subreport. You need a way to call something like a "previous" method, contrary to the "next" method that the engine always calls on the data source object. I hope this helps. Teodor By: Peter Kohlendorfer - kohlendorfer RE: Error with subreports? 2003-04-01 08:13 Hi, I did some additional investigation: In JRVerticalFiller line 160 the method fillReportStart() is called. For some reason in JRFillBand the flag "isToPrint" is set to false, so for the first row of data the subreport's fields are not evaluated at all and I do not get the subreport. For subsequent rows the call of fillReportContent() in line 169 works fine and produces all rows as I would expect. Has anybody (Teodor, please help) an idea how this can happen. To me it looks like a bug, but maybe it is some misconfiguration of the subreport. As I mentioned before when I execute the subreport alone all rows including the first one are displayed. Thanks in advance, Peter By: danita perez - danita RE: Error with subreports? 2003-05-07 10:06 My error is similar, when I call the constructor of JRVerticalFiller it appear it never returns anything, i'm trying to debug the source but now i really don't now what to do. What can be my error: In class JRFiller: public static JasperPrint fillReport( JasperReport jasperReport, Map parameters, JRDataSource dataSource ) throws JRException { ... switch (jasperReport.getPrintOrder()) { case JasperReport.PRINT_ORDER_HORIZONTAL : { filler = new JRHorizontalFiller(jasperReport, false); System.out.println("jrfiller3"); break; } case JasperReport.PRINT_ORDER_VERTICAL : { System.out.println("jrfiller44"); filler = new JRVerticalFiller(jasperReport, false); System.out.println("jrfiller4"); break; } } System.out.println("jrfiller5"); return filler.fill(parameters, dataSource); } it seems to never go out of the switch when it calls the JRVerticallFiller method thanks... By: Jose Maria Lopez - vchema RE: Error with subreports? 2003-05-14 02:36 I'm also having this problem. I pass the subreport datasorce as a field of the master report. Displaying the subreport alone works fine but when I do it as a subreport some detail lines are not showed. With different data some times there are a few pages that are not displayed, and some other times the whole detail lines are not displayed. But the data is retrieved properly, even the calculations are done perfectly. I am using version 0.4.6. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now