edwarda Posted June 8, 2010 Share Posted June 8, 2010 Hi,I'm generating a report including 2 sections, data in each from different table. So, I create 2 subreports which select data from its own tables, and lay out 2 subreports in the detail band of main report, one after another. But, the result becomes mess-up. The 2-page report keeps repeating to 100 pages, and the 2 sections overlaps each other in each repeat.Can anyone advise the proper way of doing this? Should I lay out 2 subreports to some other band? I'm using iReport 3.7.2Thanks for help in advance!E.D. Link to comment Share on other sites More sharing options...
slow Posted June 9, 2010 Share Posted June 9, 2010 try this: in the main report use a dummy query similar to this ( I use Oracle!... find something similar for your DB):select '1' as num drom dualunionselect '2' as num drom dualon the "print when expression" of the first report set:new Boolean($F{num}.trim().equals("1"))on the "print when expression" of the second report set: new Boolean($F{num}.trim().equals("2"))then put the two subreport in the detail band one on each other. _________________________________________if it works... give me KARMA points please! : ) _________________________________________listening: MUSICA NUDA - Sacrifice Link to comment Share on other sites More sharing options...
edwarda Posted June 9, 2010 Author Share Posted June 9, 2010 Thank you. I'm using Sybase, so, I tried dummy query as:select '1' as numunionselect '2' as numIt's fine now in iReport. But when I load all xml/jsper files from JasperEngine. The exception comes up as following. I tried to upgade to jasperreports-3.7.2.jar, but the compliation is failing. I guess I'm in another trouble! DEBUG [main] (JRVerticalFiller.java:298) Fill 33066941: titleDEBUG [main] (JRVerticalFiller.java:679) Fill 33066941: detailDEBUG [main] (JRFillDataset.java:747) Fill 33066941: closing query executerFailed to generate reportnet.sf.jasperreports.engine.JRRuntimeException: Unknown hyperlink target 0 at net.sf.jasperreports.engine.JRHyperlinkHelper.getLinkTarget(JRHyperlinkHelper.java:273) at net.sf.jasperreports.engine.base.JRBaseTextField.normalizeLinkTarget(JRBaseTextField.java:317) at net.sf.jasperreports.engine.base.JRBaseTextField.readObject(JRBaseTextField.java:381) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at java.io.ObjectStreamClass.invokeReadObject(Unknown Source) at java.io.ObjectInputStream.readSerialData(Unknown Source) at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source) at java.io.ObjectInputStream.readObject0(Unknown Source) at java.io.ObjectInputStream.readObject(Unknown Source) at java.util.ArrayList.readObject(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at java.io.ObjectStreamClass.invokeReadObject(Unknown Source) at java.io.ObjectInputStream.readSerialData(Unknown Source) at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source) at java.io.ObjectInputStream.readObject0(Unknown Source) at java.io.ObjectInputStream.defaultReadFields(Unknown Source) at java.io.ObjectInputStream.readSerialData(Unknown Source) at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source) at java.io.ObjectInputStream.readObject0(Unknown Source) at java.io.ObjectInputStream.readArray(Unknown Source) at java.io.ObjectInputStream.readObject0(Unknown Source) at java.io.ObjectInputStream.defaultReadFields(Unknown Source) at java.io.ObjectInputStream.readSerialData(Unknown Source) at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source) at java.io.ObjectInputStream.readObject0(Unknown Source) at java.io.ObjectInputStream.defaultReadFields(Unknown Source) at java.io.ObjectInputStream.defaultReadObject(Unknown Source) at net.sf.jasperreports.engine.base.JRBaseReport.readObject(JRBaseReport.java:736) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at java.io.ObjectStreamClass.invokeReadObject(Unknown Source) at java.io.ObjectInputStream.readSerialData(Unknown Source) at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source) at java.io.ObjectInputStream.readObject0(Unknown Source) at java.io.ObjectInputStream.readObject(Unknown Source) at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:94) at net.sf.jasperreports.engine.util.JRLoader.loadObjectFromLocation(JRLoader.java:264) at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluateSubreport(JRFillSubreport.java:321) at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluate(JRFillSubreport.java:270) at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:260) at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:486) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:1427) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:729) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:256) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:114) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:911) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:814) at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:63) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:421) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:251) at com.rbccm.firms.standalone.report.ReportGenerator.generateReport(ReportGenerator.java:104) at com.rbccm.firms.standalone.report.ReportGenerator.main(ReportGenerator.java:152) 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