Jump to content
We've recently updated our Privacy Statement, available here ×

lgameror

Members
  • Posts

    3
  • Joined

  • Last visited

lgameror's Achievements

Newbie

Newbie (1/14)

  • One Month Later
  • First Post Rare
  • Conversation Starter Rare
  • Week One Done

Recent Badges

0

Reputation

  1. For example, this is the object that is received by the service: { "data":[ { "id": 25, "name": "Pepito" } ], "reportName": "HelloWorld" }
  2. I have a doubt. Where we do the following??? In the report??? Or in the API as json-data-source???
  3. 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);
×
×
  • Create New...