Ireport dan Database Mysql

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Ireport dan Database Mysql

daniell twin
This post has NOT been accepted by the mailing list yet.
agan2 sekalian. mau nanya nih. saya buat program aplikasi dengan java nah pas di clean and build trus saya buka jarnya database mysqlnya terbaca (read : connected) tapi ireportnya tidak terbaca.
mohon bantuan dan solusinya.
trims

ini source code reportnya :
try{
            cKoneksi cc = new cKoneksi();
            cc.cConnection();
            //String report = koneksi.PathReport + "laporanKaryawan.jasper";
            File report = new File("src/report/laporanperinvoice.jrxml");
            jasdes = JRXmlLoader.load(report);

            //String nm = "";
            param.put("noinvoice",txtnotransaksi.getText());
            //param1.put("noinvoice2",cmbnoinvoice.getSelectedItem().toString());
            jasrep = JasperCompileManager.compileReport(jasdes);
            jasprint = JasperFillManager.fillReport(jasrep, param, cc.kon);// con koneksi jasper  Con koneksi database
            //jasprint = JasperFillManager.fillReport(jasrep, param1, cc.kon);
            JasperViewer.viewReport(jasprint,false);
        }catch(Exception e){

        }
Best Regards,

DT
Reply | Threaded
Open this post in threaded view
|

Re: Ireport dan Database Mysql

daniell twin
This post has NOT been accepted by the mailing list yet.
 try{              
           File report = new File("src/report/laporanoutlet.jasper");
           Class.forName("com.mysql.jdbc.Driver");
           Connection koneksi =DriverManager.getConnection ("jdbc:mysql://192.168.1.5/dbpomexindo?user=root&password=root");;
           //jasdes = JRXmlLoader.load(report);
                                                 
           String nm = "";
           param.put("",nm);
           jasrep = (JasperReport)JRLoader.loadObject(report.getPath());
           //jasrep = JasperCompileManager.compileReport(jasdes);
           jasprint = JasperFillManager.fillReport(jasrep, param, koneksi);// con koneksi jasper  Con koneksi database
           JasperViewer.viewReport(jasprint,false);
       }catch(Exception e){
           
       }

saya ganti ini masih tetap tidak bisa juga
Best Regards,

DT