0

I'm having the following problem: I have a report with sub report, where and passed as one parameter Collection. when I run into the iReports the resulado comes as planned, but when I run in my Java code, the following error appears:

Caused by: java.lang.ClassCastException: [Ljava.lang.String; can not be cast to java.util.Collection

the library version 5.5.1 and and my code that generates the PDF is:

InputStream is = this.getClass () getClassLoader () getResourceAsStream ("/" + filename)..;

JasperDesign jd = JRXmlLoader.load (s);
JasperReport jr = JasperCompileManager.compileReport (jd);

JasperPrint jp = JasperFillManager.fillReport (jr, parameters, jdbcTemplate.getDataSource () getConnection ().);

byte [] = pdfBytes JasperExportManager.exportReportToPdf (jp);
return pdfBytes;
JulioCes
  • 9
  • 6
  • show your parameters object initialization – Arasu Jul 03 '15 at 04:48
  • I was sending in my one obj parameters of type String [], where the first report performed correctly, but the sub report gave the error. By modifying the parameter to List both worked properly. ps. I used the following tip: http://stackoverflow.com/questions/2607289/converting-array-to-list-in-java – JulioCes Jul 03 '15 at 11:45

0 Answers0