I can see that the reason for the error may be that the JRVerticalFiller class, for example, creates a JRBasePrintPage in the switch (whenNoDataType) statement. The JRHorizontalFiller does this as well. You could probably replace the calls to "new JRBasePrintPage()" in the fillers to "newPage()", which is defined in JRBaseFiller, and which creates a base page or virtual page appropriately.
Cheers, John On Wed, Nov 09, 2005 at 12:23:26PM -0600, Edson Tirelli wrote: > > Dear All, > > I'm facing a very strange problem here and I couldn't find anything > related in the mailing list archive. Google also didn't helped, so you > are my hope! :) > > I have a report with the following characteristics: > > DataSource: JRResultSetDataSource > Using virtualizer: YES (JRFileVirtualizer) > Has subreports: YES (2 subreports) > > When I call: > > JasperRunManager.runReportToPdfStream(reportStream, output, parameters, > datasource); > > IF the datasource returns NO rows, I get the following error: > > [java] Caused by: java.lang.ClassCastException: > net.sf.jasperreports.engine.base.JRBasePrintPage > [java] at > net.sf.jasperreports.engine.fill.JRBaseFiller.registerSubfiller(JRBaseFiller.java:1726) > [java] at > net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:728) > [java] at > net.sf.jasperreports.engine.fill.JRFillSubreport.run(JRFillSubreport.java:427) > [java] at java.lang.Thread.run(Thread.java:595) > [java] [ERROR] Java Result: 1 > > The strange situation is that I made several experiences trying to > figure out under witch conditions I get the error, and the error occur > only when above conditions are met: I use a virtualizer, in a report > that contains subreports, with a result set data source that returns no > rows. > > If I turn off the virtualizer, everything works fine. If I run the > report removing the subreports, everything works fine. If I submit a > query that returns at least one row to the datasource, everything works > fine. > > I don't know Jasper internals, so, I gave a quick look at the > classes presented in the stack trace and there is a forced cast there > used when virtualization is true, but I couldn't figure out why it is > throwing the class cast exception. > I'll try to create a self contained test to reproduce the problem, > but until there, if any of you has any suggestions, it is greatly > appreciated. > > Thank you, > Edson > > --- > Edson Tirelli > Auster Solutions do Brasil > @ www.auster.com.br > +55 11 5096-2277 / +55 11 9218-4151 > > > > > ------------------------------------------------------- > SF.Net email is sponsored by: > Tame your development challenges with Apache's Geronimo App Server. Download > it for free - -and be entered to win a 42" plasma tv or your very own > Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php > _______________________________________________ > jasperreports-questions mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/jasperreports-questions -- "I'm a tenth level Vice President!" - Al Gore (Futurama) NOTICE: This message and any information, files or materials sent with may contain confidential and proprietary information or material of the sender, the recipient(s) or others, or information or material covered by the attorney-client privilege, attorney work product privilege, or other applicable privilege. If you are not a named recipient or if you have received this message in error, please notify the sender immediately by return email, delete this email from your system, and do not disclose the contents of this transmission to any other person, use this transmission or any of its contents for any purpose, or further copy its contents. Persons communicating with Works Operating Company, any of its affiliated companies, or any of their respective representatives by electronic means are advised and agree that such communications are reviewed for harmful or objectionable content or material. ------------------------------------------------------- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php _______________________________________________ jasperreports-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jasperreports-questions
