function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

How to call jasper4salesforce report withing programmatically?

Hi All,

    I have created a report using jasper4salesforce within Now I want to call the same report within programmatically.

    Anyone having any idea how I can do say?

    Any response is welcome.
I am readuing this as you want to set up a Link on page so that users can generate the report directly from the page. (For example, an Account Summary report from the Account details page) - please correct me if I am mistaken.

This is possible with Jasper4Salesforce, although it takes a little bit of effort since we have not yet designed this specifically. Basically, you will need to generate a custom URL that calls the report with the necessary values.

Clicking on the report name within Jasper4Salesforce will bring up the Run Report Dialogue – the URL of this page includes a reportUnit parameter in the URL that has the full path to the report. The “/” in the path are replaced by “%2F” – you will need to do this as well when generating your URL.

If your report has user inputs that you want to populate from the source page, you will need to get the input names to pass on the url.
By right clicking on the Run Report page that comes up when you click on the report title, you can view the html source of the page. Searching on “<input type=” will allow you to identify the name associated with each input – ignore inputs of type “hidden” or “submit”.

The custom link in your salesforce environment should be defined with the following URL definition – this assumes a single parameter of Account0_Id and the need to have the report run automatically rather than have the user enter values (controled by the directRun=true parameter_:<repositoryPathToTheReport>&Account0_Id_R0=<value>&directRun=true

Note that the items in <> will need to be provided by the calling page or you directly when you define the URL.

Hopefully this helps...if you have additional questions, please let us know.