0

I have a static Pentaho Report(.prpt) on my pentaho server.I am trying to find the way to pass paramater to my pentaho report and refresh(update) the report using pentaho scheduler.I am able to run the sql query each time the scheduler runs. But I want to pass parameter(user data to be used in mysql query) dynamically so that I am able to generate user specific reports for all users using same prpt file on my server.

How can that be achieved? Can anyone explain with an example regarding the dynamic query scripting in Pentaho Report Designer as there is no material which can be found for the same.

I am using Pentaho Report Designer and Server(8.1).

1 Answers1

0

You must first create a parameter on the report (under the Data Tab, choose Parameters and right-click to create a new parameter). Those parameters can be passed from the URL, or set via a selector/dropdown.

Then you can use the parameter by entering it into the query with a syntax such as shown below:

select * from sales where customer = '$(customerParam)'
nsousa
  • 4,448
  • 1
  • 10
  • 15
  • Can you state any example or documentation on "How to pass parameter using URL to the pentaho reports" as you said.I could not find anything regarding passing parameters to SQL query of Pentaho Report (PRPT file) using URL and then update the existing Pentaho Report on the pentaho server. – Mayank Singh Dec 17 '18 at 05:08
  • Just add "&paramName=paramValue" to the report's URL, where paramName is the name of the report parameter and paramValue is the value you want to pass. – nsousa Dec 18 '18 at 10:49