alan.anto.sebastian. Posted March 2, 2016 Posted March 2, 2016 i have to create reports for two pages bills and allotment .i have created report for bill page from java application and it works fine.but , the report done for allotment is not working and every time it says the document has no pages from java application but it shows rsult on previewing
Solution hozawa Posted March 2, 2016 Solution Posted March 2, 2016 There's a bug in your application. It's probably not setting the datasource correctly.
alan.anto.sebastian. Posted March 2, 2016 Author Posted March 2, 2016 String str=jTextField5.getText(); try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con; con = DriverManager.getConnection("jdbc:odbc:kbg"); JasperDesign jasperDesign=JRXmlLoader.load("C:\Users\alanantosebastian\Documents\NetBeansProjects\SHOWROOM\src\showroom\Report.jrxml"); String sql="select * from bill where billid='"+str+"'"; //String sql="select * from bill"; JRDesignQuery newQuery=new JRDesignQuery(); newQuery.setText(sql); jasperDesign.setQuery(newQuery); JasperReport jasperReport=JasperCompileManager.compileReport(jasperDesign); JasperPrint jasperPrint=JasperFillManager.fillReport(jasperReport,null,con); JasperViewer.viewReport(jasperPrint); } catch(ClassNotFoundException | SQLException | JRException e) { JOptionPane.showMessageDialog(null, e); } sir this is the code i have used .this works fine on one page and not on others.
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