Jump to content

Recommended Posts

Posted

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

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted
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.

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...