Jump to content
We've recently updated our Privacy Statement, available here ×

call iReport (jasper file) by java app. error


emidemi

Recommended Posts

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 error

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

thanks



[/code]
Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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

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