Up until now, I've been using a database connection to populate the data in my reports, which has worked well. Now I am struggling to get it working with a different type of input.
Ultimately, my goal is to have a Java process which generates an array of values, which it then passes to Jasper to generate a chart in an XLS file. For example, I may pass in {[0,0],[1,1],[2,2],[3,3]} if I wanted Jasper to generate a straight line. Each time my Java process runs, the input data will be different, however the structure of the data will be the same. I am looking into how I can pass in the data using JSON, however I am not tied to that solution. What is the best way to acheive my goal? JSON? XML? A custom Java class?
As a first step, I've tried to get the Northwind.Customers example to work. I created a new report in iReport that reads the northwind.json file and that works okay. However, when I try to call it from Java, no data populates. What am I doing wrong?
JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
JsonDataSource jsonDataSource = new JsonDataSource(new File("path\\to\\northwind.json"));
Thank you
Hi, I have a similar requirement. I am getting a JSON string from UI and I want to convert and use this as JSONDataSource. Can amyone please guide how this can be done?