Question
Jeeva Shanmugavel
IN
Last activity: 1 Nov 2017 7:04 EDT
Dynamic Query logic in Report Definition (v7)
Is there a List-View (v6) like Source Activity in Report Definition (v7) that we can leverage to dynamically control the query logic? If not, how can this be achieved?
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Tetrasoft India Private Limited
IN
Not sure of the requirement at your end but I suspect you are looking for pxRetrieveReportData activity
Use the Rule-Obj-Report-Definition.pxRetrieveReportData activity to execute the retrieval and sorting operations, but not the formatting and display processing, of a report definition.
Parameters
Specify both key parts of a report definition.
Not sure of the requirement at your end but I suspect you are looking for pxRetrieveReportData activity
Use the Rule-Obj-Report-Definition.pxRetrieveReportData activity to execute the retrieval and sorting operations, but not the formatting and display processing, of a report definition.
Parameters
Specify both key parts of a report definition.
Parameter |
Description |
pyReportClass | Select the Applies To key part of a report definition. This may identify an internal class or class group, or an external class. |
pyReportName | Select the Purpose key part of a report definition. |
pyPageName | Optional. Enter the name of the clipboard page that will hold the report results. If you do not add a value, the results are shown in the default Code-Pega-List page called pyReportContentPage. |
pyReportParamPageName | Optional. Use this parameter to override the columns returned by the report. This parameter enables you to add or remove the columns that the report returns. You can also change the sorting order of these columns.
This parameter is page name of class Embed-QueryInputs. The page structure is shown below. |
Pegasystems
IN
If by query logic you mean the number of filter conditions that need to be applied, then this can be achieved in report definition by ensuring some of the filter conditions' value part is empty (or null) so that that condition is ignored. Since one (or many) conditions are ignored as their resulting "value" part (RHS) results in empty, the filter logic is rewritten to accomodate it.
Jeeva Shanmugavel
IN
I have been doing what you have suggested. But this is not what I am looking for.
To be clear, say my criteria are as follows,
A pyID Starts With 'C-'
B pyID Starts With 'D-'
C pyID Starts With 'E-'
D pyID Is Not Null
And the Query Logic (Filter Conditions) is D AND (A OR B OR C) defined in the report - it is mandatory that the logic contains all the criteria labels.
I need to control the Filter Conditions dynamically - depending on a property value, modify the filter condition to D AND A, D AND B, D AND C etc.
This was possible in List Views in the earlier versions, where the List View has a source activity (getContent activity by default) that can be altered.
Now that list view is deperecated in v7, my question is if there is any way this can be done in Report Definitions in v7.
Rules Cube Inc.
CA
Hi Jeeva,
You can use a data page and use your Report definition as source with mandatory filter like pyID Is Not Null in the report filter. Once you have the results with pyID you can conditionally check based on the property value in the response data transform.
Alternatively you can call the pxRetreiveReportData (as dames mentioned) from activity and conditionally filter the results. Let me know your thoughts.
Thanks
Venkatesh G
Pegasystems
IN
The requirement can be met with report definition in this manner
A pyID Starts With Param.id
D pyID Is Not Null
The filter logic will be (A AND D). The value of id parameter can be set to C- or D- or E- depending on the condition which determines it. If id parameter is not present, then that filter condition is ignored and filter logic will automatically become (D).
In your example above, the A, B and C filter conditions were on the same property with the same operation. To complicate it further, let's now assume A, B and C filters are on different properties.
The requirement can be met with report definition in this manner
A pyID Starts With Param.id
D pyID Is Not Null
The filter logic will be (A AND D). The value of id parameter can be set to C- or D- or E- depending on the condition which determines it. If id parameter is not present, then that filter condition is ignored and filter logic will automatically become (D).
In your example above, the A, B and C filter conditions were on the same property with the same operation. To complicate it further, let's now assume A, B and C filters are on different properties.
A pyID Starts With Param.id
B pyStatusWork Starts With Param.statuswork
C pyCreateOperator Equals Param.operator
D myProperty Is Not Null
Notice that each of A, B and C filter conditions now has different parameters and depending whether the parameter is set on the parameter page when executing the report or not will determine if that filter is applied in the query or not. If it is no applied, the filter logic is auto rewritten to remove that condition.
-
Preethi Bommireddy
Accepted Solution
Tetrasoft India Private Limited
IN
Not sure of the requirement at your end but I suspect you are looking for pxRetrieveReportData activity
Use the Rule-Obj-Report-Definition.pxRetrieveReportData activity to execute the retrieval and sorting operations, but not the formatting and display processing, of a report definition.
Parameters
Specify both key parts of a report definition.
Not sure of the requirement at your end but I suspect you are looking for pxRetrieveReportData activity
Use the Rule-Obj-Report-Definition.pxRetrieveReportData activity to execute the retrieval and sorting operations, but not the formatting and display processing, of a report definition.
Parameters
Specify both key parts of a report definition.
Parameter |
Description |
pyReportClass | Select the Applies To key part of a report definition. This may identify an internal class or class group, or an external class. |
pyReportName | Select the Purpose key part of a report definition. |
pyPageName | Optional. Enter the name of the clipboard page that will hold the report results. If you do not add a value, the results are shown in the default Code-Pega-List page called pyReportContentPage. |
pyReportParamPageName | Optional. Use this parameter to override the columns returned by the report. This parameter enables you to add or remove the columns that the report returns. You can also change the sorting order of these columns.
This parameter is page name of class Embed-QueryInputs. The page structure is shown below. |