Hi,
I have
public ResponseObjectVO generatePDFReport(HttpServletResponse response, @RequestBody RequestReportVO requestReportVO) where RequestReportVO have two attributes
private Object data; //JSON
private String reportName;
// Template
String filePath = reportPath;
filePath = filePath + File.separatorChar + reportName;
JasperReport report;
report = JasperCompileManager.compileReport(filePath.concat(JRXML_EXT));
//Data Source
List<Object> listData = new LinkedList<>();
Object data = requestReportVO.getData();
listData.add(data);
JRDataSource dataSource = new JsonDataCollection<>(listData); // How to pass a JSON????????
// Print
JasperPrint jPrint = JasperFillManager.fillReport(report, null, dataSource);
String filename = reportName;
filename = filename.concat(PDF_EXT);
String target = "D:" + File.separatorChar;
JasperExportManager.exportReportToPdfFile(jPrint, target + filename);