Report Definitions
|
|
The Query tab defines the basic content of the report, including the rows and columns to be included on the report. The information on this tab determines the SQL query that will be executed to retrieve the data for the report.
Complete the Edit columns section at the top of the tab to define the columns to include, and how to format and display their values, and the Edit filters section to describe which class instances or records to include.
This section defines the columns in the report. They appear in the report in the same order that they appear in this list. To change the column display order, click and hold the small circle at the left of the column, and drag the column up or down until it is where it should be, then release the mouse button to drop it into its new position.
For each column in the report, the following fields are available:
Field | Description |
---|---|
Column Source |
Choose a Single Value property, identified by a property reference. Instead of an existing single value, you can use the Calculation Builder to select a function template and provide database columns for it to operate on. The column in the report then displays the result of the SQL function. If your application has declare index rules, you can choose one of the properties in the declare index as a column. Type part of the declare index name, then click the down-arrow. The rule appears as one of the "Best Bets". If you enter the name of property that has not been optimized, your system may experience a performance slowdown when running the report. You may want to use unoptimized properties while working out the report's structure and contents, but make sure all properties are optimized before moving the code to a production system. In many situations you can use a linked property to populate a column (or the right side of a filter condition; see below). If you are building a report on unresolved work items, you can include a column with the access group of the creator of the work item by using this linked property: .pxCreateOperator.pyAccessGroup. You cannot reference data page properties that themselves take parameters (such as D_page1[companyName:D_page2[param2:Param.P1],param2:pxRequestor.pyUserIdentifier].pyLabel), although you can directly reference properties in a data page (such as D_page1.companyName). |
Column Name |
Enter a column heading to be used for this column on the report. By default, the label defined for the selected property appears as the column heading. This field is required for most columns, but is not required when the Summary Function field has a value. |
Summarize | Choose one of the built-in functions COUNT(), COUNT DISTINCT(), SUM(), AVG(), MAX(), or MIN() to aggregate the data in the column. Depending on your choice of property for the column, some summary functions may not appear as options. |
Sort Type |
Optional. For each sorted column, you can choose one of the following:
|
Sort Order | Optional. If you are sorting the values for more than one column on the report, enter a unique value for each sorted column as an integer between 1 and the number of sorted columns. |
Click the gear icon at the right of any row to select formatting options for that column in the form that appears:
Option | Description |
---|---|
Column width |
Enter the desired column width for the column as a percentage of the window's width or in pixels. Enter an integer in the first field and, in the second field, select either px or %. |
Column format | Select a format to use for the values for the column. Leave blank to use the default format associated with the property. Many formats accept parameters. |
Display Values Across Columns | Available only for summary reports. Check to create a pivot-table style report, in which values for one or more columns display horizontally. |
Hide column | Available only for list reports. Check to hide the column in the displayed report. |
Click the trash-can icon at the right of any row to delete the column from the report.
Click Add column at the bottom of the section to add new columns to the report.
This section defines filter conditions, which determine which rows of data are included in the report. If you leave this section empty, the report selects all instances of the Applies To class (or instances or records of whatever sources are indicated on the Data Access tab) up to the limit in the Maximum Number of Rows to Retrieve field on the Data Access tab. PRPC converts information in this section to an SQL WHERE clause when retrieving data from the database.
It is very important to define appropriate filter conditions in every report to prevent overly expensive reports. Always define filter conditions that are as restrictive as possible, while still including the data needed for the report user.
This section has three areas:
If you define filter conditions in this section, you must enter a logical expression in the Filter conditions text box above the list of filter conditions. Using the labels entered in the Condition column, enter a logical expression that specifies how to combine the conditions. The expression can include parentheses and the operators AND and OR. For example, if the table contains four rows labeled A, B, C, and D, you can enter an expression like (A OR B OR C) AND D in this text box. The expression must include all labels within the Condition column; that is, it must include every filter condition.
Each row of the array in this section identifies a filter condition. The order of rows is not significant. PRPC converts information in this array to an SQL WHERE
clause when retrieving data from the database.
Field | Description |
---|---|
Condition |
Enter a letter or letters that uniquely identifies this row, to reference this row in the Logic field. These can be as simple as |
Caption |
Optional: Provide a caption to identify the filter condition in the Filters list that displays above the data when the report runs. Depending on which option you selected in the Filter Caption Settings at the bottom of the section, the caption you set for each condition applies to the column within the condition (if the caption is "customer", then "customer = 'brown'"), or to the entire condition ("customer"). |
Column source |
Enter a property reference for the conditions. The property referenced must be exposed as a database column in the Applies To class for the report value, or else be a fully qualified value to a clipboard page that is always present on the clipboard, such as the requestor page or process page. Caution: You can specify only Note, however, that you can specify single value properties that are produced by a SQL function. To use the result of a SQL function query, click the Calculation Builder icon to the right of the field. The Calculation Builder displays, and there you can select a SQL function and specify any parameters it needs. Note: If the Type of this property is If you enter .pxObjClass here and the Applies To key part of this report definition is a framework class, and if the developer has checked the Report on Descendant Class Instances check box in the Report Definition form, at runtime the report execution can use the corresponding implementation class, not the framework class, for comparisons and report content. This feature eliminates the need to copy each framework class-based report definition into the implementation class. |
Relationship | Select a logical operator for the comparison condition, such as Is Equal or Starts With . |
Value |
Enter one of the following options as a comparison value:
If the Relationship field is set to IS NULL or IS NOT NULL, leave this field blank. Commas correspond to an OR test: if the Value field contains two or more entries separated by commas, the comparison is true at runtime if the value of the Column field equals (or is greater than, or is contained in, and so on) any one of the entries. When the Value field contains a When evaluating either of the two Condition values Using the Select Values pop-up window For guided assistance in completing this field, click the magnifying glass icon . A pop-up window appears with one or more of these tabs:
|
Click the gear icon at the right of any condition row to edit filter options:
Option | Description |
---|---|
Field value key | Provide the field value key used for localizing the pick-values pop-up window (described above) that appears in the Report Viewer when the user makes changes to filter conditions. |
Report Viewer options |
Select a value to determine how a user of this report can modify the condition in this row when the report is run and displayed in the Report Viewer.
|
Use Null if empty |
This option is important only when there is no value at runtime specified in the Value field. By default, when the Value field is empty at runtime, the criterion defined by this row is ignored; processing is the same as if this row is not present. For example, assume the criteria is that the customer's last name starts with a given letter, and the value set in the Value field is param.Letter. If this report rule executes at a time when Param.Letter has the value "C", this criterion limits the report to contain only instances in which the Lastname property value starts with the letter C. However, if the same rule executes again when the Param.Letter parameter has no value, this criterion is dropped, so instances with any Lastname value (or none) are selected. In situations where this default behavior is not desirable, select the Use Null box to force the Condition value to become |
Ignore case |
Select to have runtime comparisons of the Field value and the Value value be case-insensitive; that is. "Smith" matches "SMITH" and also matches "sMiTH". If selected, then at runtime " Clear to cause tests of the Field value and the Value value to occur without case conversion. In this case, " Caution: In most cases, do not select this option. Select this box only when necessary to obtain the rows of the report:
|
This control lets you specify whether the caption you set for each condition (such as "customer" applselecting s to the left side of the condition ("customer = 'brown'"), or to the entire condition ("customer").
If your report includes an aggregate column, you can add filters the system applies after calculating aggregate values. Using these filters you can, for instance, display the rows that fall below or between some minimum (severity < 50) or maximum (rating > 75) aggregate value.
Note: If you define filter conditions in this section, you must enter a logical expression in the Filter conditions text box above this list of conditions, as described above for the first set of filter conditions.
For each filter condition fields these fields are available. You do not provide captions for these filter conditions, as they do not appear in the display in the Report Viewer; nor the column source since it is the aggregate column of the report.
Field | Description |
---|---|
Condition |
Enter a letter or letters that uniquely identifies this row, to reference this row in the Logic field. These can be as simple as |
Function |
Select the aggregation function for the aggregate column on which you want this filter to operate. If the function is COUNT and the column label is "customer", the function option appears here as "COUNT(customer)" to distinguish it from functions related to other aggregate columns in the report. |
Relationship | Select a logical operator for the comparison condition, such as Is Equal or Greater Than . |
Value |
Enter one of the following options as a comparison value:
Commas correspond to an OR test: if the Value field contains two or more entries separated by commas, the comparison is true at runtime if the value of the Column field equals (or is greater than, or is contained in, and so on) any one of the entries. When the Value field contains a When evaluating either of the two Condition values |
Additional options may appear:
Control | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
Remove Duplicate Rows | For list-type reports, when this option is selected, the report discards rows that have duplicate values for the columns selected for the report. This action does not modify the stored data. | ||||||||
Filter By Rule Resolution |
For Report Definitions defined on the Rule- class, or a class derived from Rule-, check this check box to restrict the rule instances included to those that satisfy PRPC's rule resolution procedures. Circumstancing is ignored. |
||||||||
Filter By Application Context |
For Report Definitions defined on the Rule-class, or a class derived from Rule-, check this check box to restrict report coverage to those in a certain application context. When you check this check box, additional fields appear to let you set application context filters:
When application context filtering option, you can add and sort report results by the values in a hidden column like pyRulesetVersion. |
For list reports, you can limit the number and type of rows of data the report returns to those with the highest or lowest values of some property:
As an example, for a report that shows the three most recently-entered cases for each customer, sort the results by customer, check Group results to group the results by customer, and then in the Top/Bottom Rank section enter:
Display Top ranked 3 Rows For each group based on .pxCreateDateTime