2005 IR Help Posted August 24, 2006 Share Posted August 24, 2006 By: Flavio Giovanni - fgiovanni Class Error 2004-03-17 07:33 Hello people.. I create a Class, but this not inicialize the report. Look the code: Code:public void init() { String sFileName = "http://192.168.200.3:8080/jasper/reports/WebappReport.jasper"; if (sFileName != null) { try { Class.forName("org.gjt.mm.mysql.Driver"«»); Connection con = DriverManager.getConnection("jdbc:mysql://192.168.200.3/NewRIPilotoR1SP", "siscart", "bluelau"«»); HashMap parametros = new HashMap(); String sql_cons = "SELECT * FROM reg_cab WHERE protocolo = 130756"; parametros.put("sql", sql_cons); jasperReport = (JasperReport)JRLoader.loadObject(new URL(getCodeBase(), sFileName)); jasperPrint = JasperManager.fillReport(jasperReport, parametros, con); //jasperPrint = JasperFillManager.fillReport(jasperReport, parametros, con); JasperViewer.viewReport(jasperPrint); } catch (Exception e) { StringWriter swriter = new StringWriter(); PrintWriter pwriter = new PrintWriter(swriter); e.printStackTrace(pwriter); JOptionPane.showMessageDialog(this, swriter.toString()); } } else { JOptionPane.showMessageDialog(this, "o caminho nã¯foi especificado"«»); } }Post edited by: tcloonan, at: 2006/08/25 05:19 Link to comment Share on other sites More sharing options...
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