It is fine when create the Jasper report(PDF, Excel, Csv) by using JRBeanCollectionDataSource. It means that the .jrxml file accepts the collection of pojo as a input to process the report.
Now, I have been trying to create the jasper report with the same .jrxml but from JSON Object. I tried the following, but all values are null in pdf report
Resource resource = new ClassPathXmlApplicationContext().getResource("classpath:reports/project.jrxml");
JsonDataSource ds = new JsonDataSource(new File("c:\myjson.json"));
jasperDesign = JRXmlLoader.load(resource.getInputStream());
JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, ds);
JasperExportManager.exportReportToPdfFile(jasperPrint, destination+fileName+".pdf");
Can any one help me?