Hi,
I had created a report whose dataset type is SQL. In that Query i had set multiple parameters to set where clause based on what is selected from the parameters and values of parameters must also be dynamically set in report.
Hi,
I had created a report whose dataset type is SQL. In that Query i had set multiple parameters to set where clause based on what is selected from the parameters and values of parameters must also be dynamically set in report.
Do you want to run this report from the code passing the necessary parameters?
If that’s your question then look at ReportRunner
bean. It allows you to run reports from your code.
For example, run report for entity with report-file download:
ReportOutputDocument rep = reportRunner.byReportCode("FLAT_INFO").addParam("entity", getEditedEntity()).run();
downloader.download(rep.getContent(),rep.getDocumentName(), DownloadFormat.PDF);
Hi
I tried ReportOutputDocument code but Report is not getting open in table format (Nothing opens when run is executed in reportoutputdocument) but in Reports API on click of runreports button table is opened but same is not working from code manually.
ReportOutputDocument rep = reportRunner.byReportCode("username1")
.addParam("reg","West")
.run();
Can you share demo project if possible.
Thanks in advance
My example was for a report with an output format as a file. And for the case when you need to run a report with parameters and immediately get a file of the report for download.
If your report has the output format ‘TABLE’ then it does not make sense because such a report does not create a output file.
A report with the output format ‘TABLE’ opens in the application interface.
You can use the ‘uiReportRunner’ bean to run the report and display it in the UI.
uiReportRunner.byReportCode("username1")
.addParam("reg","West")
.runAndShow();
The documentation contains examples of how to use uiReportRunner.