Understanding Report Scopes
A report scope enables you to create multiple instances of a report using a single report layout and report request. Using a scope, each report instance contains data specific to an individual field value, such as a business unit or department, or to a group of values, such as a tree node that summarizes all sales departments. In this way, each report instance can share the same layout, while containing data unique to these field values. You might run three instances of an expense report that share the same layout but contain the expenses of one division each.
When defining a report request, you can use the scope feature to create multiple instances of a report from a single request.
You can specify more than one field in the scope to create instances that represent combinations of values of multiple fields. For example, you can use a multifield scope to create an instance for each product line (a grouping of products) within each region (a grouping of departments).
Whenever you use scope to produce multiple instances of a report, use PS/nVision variables in the layout headings to identify the content of each report.
When you define a new scope, you must determine how many instances to produce and how each instance is summarized.
If your scope is based on two or more fields (such as business unit and product), PS/nVision normally produces a report instance for each combination of the selected nodes or detail values for all specified fields. However, you might have data for only a subset of these combinations—for example, if each business unit sells only a subset of the total list of products. You could limit the number of report instances produced by defining multiple scopes, specifying only the valid combinations, and using different report requests to apply these scopes to appropriate layouts. But if you are working with many combinations, a better solution is to create a field combination table containing only the field value combinations you want for your scope. If you specify a field combination table, PS/nVision generates an instance of the report for only those field values that are listed as valid combinations on the table.
You create a field combination table in Application Designer just as you would create any other custom table. After creating the table with the combinations of fields to use, you point to that table from the Field Combination Table field in the PeopleSoft nVision Scope Definition dialog box.
You can also create a dynamic record that is populated by a query and includes only the combinations of field values that actually have data for that reporting period. This eliminates printing blank pages (report instances) when you have fields that have no data for a particular reporting period.
Note: When you create a combination table, you need only include the scope fields whose values you want to limit, but you can also include SETID and EFFDT. You can populate the table using a SQL tool as well, but a better option might be to create a simple page to update the table.
If you specify field values using tree nodes, PS/nVision uses the combination table to determine whether the underlying details are valid before producing an instance for a tree node. For example, if an instance is requested for each product and division (a rollup of departments on an organization tree), PS/nVision determines whether any departments in each division are valid in combination with a particular product. In this case, the combination table should contain a DEPTID and PRODUCT field, with each row containing the valid department/product combinations.
Using Business Unit Keyed Trees
You can define report scopes using business unit keyed trees by adding a valid business unit to the scope definition. You must still enter a setId as the key field for the scope, and the business unit you enter is used for selecting business unit keyed trees. At the field level, you must select the BU Keyed Tree option to limit the tree selection list to those trees keyed by the business unit entered.
At runtime, the requesting business unit is used as a replacement for the business unit that you entered when defining the scope. Therefore, if you define a tree with the same name for multiple business units, you can use the same scope for each version.