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