julioces Posted July 2, 2015 Share Posted July 2, 2015 hello, 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[/code] 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;[/code] Link to comment Share on other sites More sharing options...
hozawa Posted July 2, 2015 Share Posted July 2, 2015 Is your "parameter" a "HashMap<String, Object>()"? 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