JasperServer uses REST to run a report with the data source specified at runtime

I have no problem running a report on JasperServer using a RESTful api when the report block has a predefined data source.

What needs to be done, although it allows my clients to choose which database they want to run the report in when they are preparing to run the report. I suggested that when I make a PUT request to run a report, I could just throw the data source resource descriptor into the ReportUnit resource descriptor passed to the PUT, but it does not seem to work.

I even went so far as to pull out the ReportUnit resource descriptor when it had a data source set. It was tested that the transfer of this descritor resource to the PUT worked. Then they deleted the data source with preliminary data and tried to run the report again using the exact resource descriptor that I pulled earlier, and it will not work.

Is it possible?

+4
source share
1 answer

Maybe I'm wrong, without much reading, I think you can create a data source and domain through resource services.

To update the report file using the resource service, you may need to modify the domainQuery node.

I pulled jrxml for my json based report file and looked something like this:

<resourceDescriptor name="domainQuery.xml" wsType="xml" uriString="/adhoc/topics/myjsonposts_files/domainQuery.xml" isNew="false"> 

Hope this helps you find a solution.

+1
source

Source: https://habr.com/ru/post/1400617/


All Articles