This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Other Open Source Projects and the fly likes how to create two simple jasper subreport and integrated to master report Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "how to create two simple jasper subreport and integrated to master report " Watch "how to create two simple jasper subreport and integrated to master report " New topic
Author

how to create two simple jasper subreport and integrated to master report

singh Mari
Greenhorn

Joined: Mar 25, 2009
Posts: 6
sir,
Thank you for your reply.now i correct null connection error. The following code used"

master.jrxml
<connectionExpression><![CDATA[java.sql.DriverManager.getConnection("jdbc:mysql://localhost:3306/sims1", "root", "pwd")]]></connectionExpression>

But i run the program only master report can occur not subreport.
The exact code i used:

Print.java
//Map parameters = new HashMap();
//parameters.put("SUBREPORT_DIR",subreport);
HashMap<String, String> parameters = new HashMap<String, String>();
Class.forName("com.mysql.jdbc.Driver");
Connection con = (Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/sims1", "root", "pwd");
//Statement stmt = (Statement) con.createStatement();
//ResultSet rs = stmt.executeQuery("SELECT * FROM consolidateprint");
//JRResultSetDataSource dataSource = new JRResultSetDataSource(rs);
JasperReport jasperReport = JasperCompileManager.compileReport("C://SIMS/web/error1.jrxml");
// JasperReport jasperReport1 = JasperCompileManager.compileReport("C://SIMS/web/suberror1.jrxml");
JasperPrint jprint = JasperFillManager.fillReport(jasperReport, parameters,con);
JasperViewer jasViewer = new JasperViewer(jprint, false);
jasViewer.setVisible(true);
jasViewer.toFront();

so i want how to pass the parameter, connection to jasper subreport

Please sir help me for this problem.


Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to create two simple jasper subreport and integrated to master report