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());
}
}
Above is my script.
This is my 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)
Does anyone know why this is occurring and how to fix it?
It’s a problem with the character codification. Have you tried changing the encoding line at the beginning of the report?
i.e. for central european alphabet, change:
by
You have a list of different character encoding standards here:
http://en.wikipedia.org/wiki/Character_encoding#Common_character_encodings
Hope it works