emidemi Posted April 3, 2012 Share Posted April 3, 2012 public void openReport(){ try { HashMap params=new HashMap(); params.put("aapor",19); JasperReport jasperReport1 =JasperCompileManager.compileReport("C:/Users/emidemi.emidemi-PC/Documents/NetBeansProjects/FleetManager/src/FleetManager/newReport5.jasper"); JasperPrint jasperPrint1 =JasperFillManager.fillReport(jasperReport1, params, conn.getConn()); JRViewer viewer = new JRViewer(jasperPrint1); } catch (Exception e) { System.out.println(e.getMessage()); }} [/code]i have the errorcom.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequence. BUILD SUCCESSFUL (total time: 7 seconds)is anyone know what i will a dothanks[/code] Link to comment Share on other sites More sharing options...
sanbez Posted April 3, 2012 Share Posted April 3, 2012 JasperCompileManager.compileReport - is comile report1.jrxml into report1.jasper If you have already compiled report (report1.jasper) you must write:JasperReport jasperReport1 = (JasperReport) JRLoader.loadObjectFromFile("C:/Users/emidemi.emidemi-PC/Documents/NetBeansProjects/FleetManager/src/FleetManager/newReport5.jasper");JasperPrint jasperPrint1 =JasperFillManager.fillReport(jasperReport1, params, conn.getConn()); 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