I am a beginner in jasper reports. Also Subreports concept is very very new to me. I am having Mater_Report with 2 sub reports like this :
Master_Report-->Sub_report1->Sub_Report2
I am using custom datasource to fill the reports
I m not sure how to compile it programmatically, i have tried but i am getting following rntime error while filling the master reports. The Stack trace of error is:
xception in thread "main" net.sf.jasperreports.engine.JRRuntimeException: Unkown print order 0.
at net.sf.jasperreports.engine.fill.JRFillSubreport.initSubreportFiller(Unknown Source).......................
at net.sf.jasperreports.engine.JasperFillManager.fillReport(Unknown Source)
at ReportTableCompiler.main(ReportTableCompiler.java:59)
The code used for compiling reports is :
JasperPrint print=new JasperPrint();
jdesign = JRXmlLoader.load("D:\\sub_report1.jrxml");
jasperReport = JasperCompileManager.compileReport(jd1);
Map parameters = new HashMap();
parameters.put("sub_report1", jasperReport);
design= JRXmlLoader.load("D:\\sub_report2.jrxml");
report=JasperCompileManager.compileReport(design);
parameters.put("sub_report2", report);
design1=JRXmlLoader.load("D:\\master_report.jrxml");
report1=JasperCompileManager.compileReport(design1);
//Getting error on executing the following line
print=JasperFillManager.fillReport(report1, parameters, new TableDataSource());
JasperViewer.viewReport(print);
Thanks in advance.. Pls help me solving this issue. or tell me the steps on how to use subreports & how to compile subreport programmatic(java code).
Master_Report-->Sub_report1->Sub_Report2
I am using custom datasource to fill the reports
I m not sure how to compile it programmatically, i have tried but i am getting following rntime error while filling the master reports. The Stack trace of error is:
xception in thread "main" net.sf.jasperreports.engine.JRRuntimeException: Unkown print order 0.
at net.sf.jasperreports.engine.fill.JRFillSubreport.initSubreportFiller(Unknown Source).......................
at net.sf.jasperreports.engine.JasperFillManager.fillReport(Unknown Source)
at ReportTableCompiler.main(ReportTableCompiler.java:59)
The code used for compiling reports is :
JasperPrint print=new JasperPrint();
jdesign = JRXmlLoader.load("D:\\sub_report1.jrxml");
jasperReport = JasperCompileManager.compileReport(jd1);
Map parameters = new HashMap();
parameters.put("sub_report1", jasperReport);
design= JRXmlLoader.load("D:\\sub_report2.jrxml");
report=JasperCompileManager.compileReport(design);
parameters.put("sub_report2", report);
design1=JRXmlLoader.load("D:\\master_report.jrxml");
report1=JasperCompileManager.compileReport(design1);
//Getting error on executing the following line
print=JasperFillManager.fillReport(report1, parameters, new TableDataSource());
JasperViewer.viewReport(print);
Thanks in advance.. Pls help me solving this issue. or tell me the steps on how to use subreports & how to compile subreport programmatic(java code).
Karthikeyan
22 Jun 2010