Report Parameters - Default Value


How can I pass a “dynamic” default value to my report parameters?

For example, I have a report displaying some billing information of projects, based on a project range defined by the 2 parameters: From Project and To Project (parameters of type entity linked to the project entity).
How can I set the default values for these params to take the first and last project ID in the system, so that all projects are selected by default?



Can this code sample help you?

Report report = getInvoiceReport();
if(report != null) {
    Map<String, Object> params = new HashMap<>();
    params.put("invoice", invoicesTable.getSingleSelected().getId());
    reportGuiManager.printReport(report, params);

In this code you can put params and send them to Report when running.
You can call this code from Editor.

Hi Kjell,

Its a standalone report built from the report module with parameters.
When I click on run report, I get my parameters window.

There is an option to set a static default value for these parameters, but not a dynamic or computed one.

I do not this your code can help in this case as this is not a report linked to a screen where the parameters can be passed the way you described.