How to Add Report Dynamic Parameter to DDSP

Report parameters are defined through the report contract class, or directly on the report as a part of its RDL contract. There is also a special kind of dynamic parameter that is defined through a query.

Take a look at the Inventory journal lines report. It can be open from Project management and accounting -> Journals -> Item.

This report has a dynamic parameter defined by the InventJournalTrans query. We can select values for various ranges in the Records to include tab page on the report dialog form by clicking the Filter button as shown on the picture below.

In the query browser form we can also add additional ranges on a field from any table that is a data source in the query, or it is related to a data source in the query. That is why this parameter is called dynamic parameter.


Note that the value of a range is not necessary a fixed value, it can also be a set of values, or a value with wildcards. It is hard to parse query ranges and to assume what would be specific needs for a particular report.

Because of all that a dynamic parameter is not included in Docentric report data source by default. If you need to include some of the fields that can have range values set, you can do this easily by extending the addParameters() method of the report custom Docentric DSP class.

Take a look at the report custom DSP class with the overridden addParameters() method.

This example also demonstrates how to add additional data to a report data source which is a query and not an SSRS DP (data provider) class, without changing the query itself, by overriding the addAdditionalDataFieldsForQueryRecord() method in the report Docentric DSP class.

Besides that, we also iterated through the all report parameters and all dynamic parameter query ranges to print them to Screen. The Print log parameter needs a special treatment because it is not automatically added to the report data source.

In Docentric report setup we have to select this DSP class (DocInventJournalTransDSP) instead of the Default DSP class.

When we execute the report, we will get all report parameters and all dynamic parameter query ranges printed out to Screen.


You can also see how our custom logic in the DSP class has affected the report data source.


See also

How to Add Additional Data to a Query Based Report >>
Docentric Training for Writing Custom DSP Classes >>
How to Use Docentric AX APIs >>
Visual Studio Templates for DSP Classes >>