Sending data to report to display

0

Hello everyone 

i want to display report in my web application using Visualize.js and jasper report server , i configure all thing (server , frontend, backend ..). and the report connect to database and display the report ,but i do not want jasper server to connect to my database . i want to send the data to jasper server and render the report in my web application using Visualize.js. 

is there any way to send data to report , some thing like sending paramter to server & report.

thank you .

ali.shreef's picture
Joined: May 4 2019 - 4:27am
Last seen: 3 weeks 6 days ago

4 Answers:

1

No. It's the JasperReports Server that fetches the data.

If you want to push the data, you'll need to write a servlet to accept the data and pass it to JasperReports library as a data source (such as csv and beans) and generate a report. 

hozawa's picture
43009
Joined: Apr 24 2010 - 4:31pm
Last seen: 1 week 26 min ago
0

thank you for your answer hozawa .

colud you provide me with example or documentation to accomplish this ?

is it posible to do it with JSON?

 

thank you again.

ali.shreef's picture
Joined: May 4 2019 - 4:27am
Last seen: 3 weeks 6 days ago
0

I have an old stackoverflow post explaining how to push XML/JSON data to a report deployed in JasperReports Server and some basic ways to test it:

https://stackoverflow.com/a/37441567/5882963

That could be a starting point.

narcism's picture
979
Joined: Nov 22 2010 - 12:39am
Last seen: 2 hours 8 min ago
0

Do you want to send your json every time you generate a report or want to update the data so other users would be able to view the report with the updated data?

narcism way of passing json string via parameter would work when json string is passed each time the report is to be generated.

If you want to update the data used to generate a report, all that's required is to create a simple servlet to receive the json data and save it in a data source. (e.g. update data in in memory database or beans.)

Following page contains a simple example of a servlet. It's possible to deploy the servlet on the same Tomcat as JasperReports Server.

https://javatutorial.net/java-servlet-post-example

hozawa's picture
43009
Joined: Apr 24 2010 - 4:31pm
Last seen: 1 week 26 min ago
Feedback
randomness