Jump to content
We've recently updated our Privacy Statement, available here ×

dori.jasper.engine.JRException??&#6


ktrinad

Recommended Posts

By: joking - neuzq

dori.jasper.engine.JRException???

2004-08-18 20:44

I create a master report "cross" which contains three subreports "Subreport1","Subreport2" and "Subreport3", and I define three parameters sub1,sub2 and sub3 in the master report in order to reference the subreports. This design is ok while compiled in the iReport. But when I ran the jsp file, it gave me the following error information:

dori.jasper.engine.JRException: Could not load object from location : Subreport1.jasper

at dori.jasper.engine.util.JRLoader.loadObjectFromLocation(JRLoader.java:301)

at

dori.jasper.engine.fill.JRFillSubreport.evaluate(JRFillSubreport.java:337)

at

dori.jasper.engine.fill.JRFillBand.evaluate(JRFillBand.java:383)

at

dori.jasper.engine.fill.JRVerticalFiller.fillPageBand(JRVerticalFiller.java:1092)

......................................

 

 

the content of my jsp file is:

 

 

Stringpath= "E:/ReportTest/web/report/cross.jasper";

File reportFile = new File(path);

JasperReport jasperReport = (JasperReport) JRLoader.loadObject(reportFile.getPath());

 

Map parameters = new HashMap();

 

String path1 = "E:/ReportTest/web/report/Subreport1.jasper";

File reportFile1 = new File(path1);

JasperReport jasperReport1 = (JasperReport) JRLoader.loadObject(reportFile1.getPath());

 

String path2 = "E:/ReportTest/web/report/Subreport2.jasper";

File reportFile2 = new File(path2);

JasperReport jasperReport2 = (JasperReport) JRLoader.loadObject(reportFile2.getPath());

 

String path3 = "E:/ReportTest/web/report/Subreport3.jasper";

File reportFile3 = new File(path3);

JasperReport jasperReport3 = (JasperReport) JRLoader.loadObject(reportFile3.getPath());

 

 

 

parameters.put("sub1", jasperReport1);

 

parameters.put("sub2", jasperReport2);

 

parameters.put("sub3", jasperReport3);

 

Connection conn = null;

String dbDriver= "COM.ibm.db2.jdbc.app.DB2Driver";

String url = "jdbc:db2:DELL_OA";

String userName = "OA";

String password = "oa330";

Class.forName(dbDriver).newInstance();

conn = DriverManager.getConnection(url, userName, password);

 

JasperPrint jasperPrint =

JasperFillManager.fillReport(

jasperReport,

parameters,

conn

);

 

JRHtmlExporter exporter = new JRHtmlExporter();

 

StringBuffer sbuffer = new StringBuffer();

 

Map imagesMap = new HashMap();

request.getSession().setAttribute("IMAGES_MAP", imagesMap);

exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);

exporter.setParameter(JRExporterParameter.OUTPUT_WRITER, out);

exporter.setParameter(JRHtmlExporterParameter.IMAGES_MAP, imagesMap);

exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI,

"image.jsp?image=");

 

exporter.exportReport();

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...