Sample 37459: Creating a custom table of contents in SAS® Web Report Studio that links to different report sections
Overview
One of major new features in SAS Web Report Studio 4.2 is the ability to link to different sections in a report. You can link to sections within the same report or within another report. This sample explains how you can use this feature to create a custom table of contents that links to individual sections.
About the sample data and report
The data source used in this sample is the SASHELP.PRDSALE table, which is shipped with SAS. The table is used as the data source for an information map. The information map is used to create a three-section report. Each section has a filter applied that displays information only for a specific country.
Assumptions
In order to follow along with this sample, you must have the following tasks already completed:
- The PRDSALE table is registered in metadata.
- You have created an information map with the data items from PRDSALE.
- You have a three-section report that is based on the PRDSALE information map. Each section has a filter for a specific country. The sections are named something like: Germany Sales for Qtr, Canada Sales for Qtr, and U.S.A. Sales for Qtr.
Create a data item for each report section
Besides the data items that are already included with the PRDSALE table, you must create a new data item for each section of your report.
- In SAS® Information Map Studio, open the information map that includes the data items from PRDSALE.
- Select Insert ► New Data Item.
- In the Data item name box, type Section 1.
- Under Expression settings, click Edit.
- For Type, select Character.
- In the Expression Text box, enter the following expression, and then click OK to return to the Properties dialog box.
case when <<PRDSALE.COUNTRY>> = 'GERMANY'
then 'Germany Sales for Current Quarter' else ' '
end
|
- Select Classifications, Aggregations, Formats. In the Formats section, for the Valid width range option, enter 50.
- Select Value-Generation Method, and then select User selects values from a dynamic list.
- Click OK to exit the Properties dialog box.
- Repeat steps 2 through 9 to create two more data items, named Section 2 and Section 3. When entering the case expression, edit the expression so that one data item filters for CANADA and the other data item filters for U.S.A.
When you are done, your information map should look something like this:
- Save the information map.
Create a report section for the custom table of contents
- Open the three-section SAS Web Report Studio report that is based on the previously discussed information map. Recall that each section has a filter for a specific country. In this sample, the sections are named Germany Sales for Qtr, Canada Sales for Qtr, and U.S.A. Sales for Qtr.
- In Edit mode, select Insert ► New Section. Name the section Table of Contents, and leave the Get new data option selected. Click OK.
- In the Table of Contents panel on the left, select Options ► Reorder Sections. Move the new section up in the list so that it is the first section in the report.
- With the Table of Contents section displayed, select Data ► Select Data.
- Select the PRDSALE information map that contains the Section 1, Section 2, and Section 3 data items. Add just those data items to the section.
- Insert three list table objects into the layout. You will need to add a row to the layout grid using the third icon on the vertical toolbar.
- Reassign data items in each table as described next:
- Right-click on the first table object and select Assign Data, and then hide all data items except Section 1.
- Right-click on the second table object and select Assign Data, and then hide all data items except Section 2.
- Right-click on the third table object and select Assign Data, and then hide all data items except Section 3.
- Right-click on the first table object and select Filter and Rank.
- Select Filter and Get Values.
- Move the available value over to the Selected values box.
- Repeat the steps 8 through 10 to add the corresponding filter to the other two table objects. For example, the second table might have the Canada filter and the third table might have the U.S.A. filter.
Link each table to the corresponding section in the report
- Right-click on the first table and select Report Linking.
- Select the Include report links in the table option.
- Select the An existing report option.
- Select the report that contains the three sections.
- Click Set Up Destination Report.
- Beside the Open to section prompt, select the section of the report you want to link to, as shown in the following example.
- Repeat steps 1 through 6 to link each table to its corresponding section.
Results
The Table of Contents section should now appear something like this.
Tip: In this sample, the Applied Filters box, which appears by default above each table, is hidden. To hide the Applied filters box, select View ► Applied Filters so that the check mark next to the Applied Filters option is removed.
Additional Documentation
For more information about SAS Web Report Studio, see the SAS Web Report Studio documentation page.
For more information about SAS Information Map Studio, see the SAS Information Map Studio documentation page.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
One of major new features in SAS Web Report Studio 4.2 is the ability to link to different sections in a report. You can link to sections within the same report or within another report. This sample explains how you can use this feature to create a custom table of contents that links to individual sections.
Date Modified: | 2009-10-21 13:58:38 |
Date Created: | 2009-10-14 11:32:57 |
Operating System and Release Information
SAS System | SAS Web Report Studio | z/OS | 4.2 | | 9.2 TS2M0 | |
Microsoft® Windows® for x64 | 4.2 | | 9.2 TS2M0 | |
Microsoft Windows Server 2003 Datacenter Edition | 4.2 | | 9.2 TS2M0 | |
Microsoft Windows Server 2003 Enterprise Edition | 4.2 | | 9.2 TS2M0 | |
Microsoft Windows Server 2003 Standard Edition | 4.2 | | 9.2 TS2M0 | |
Microsoft Windows XP Professional | 4.2 | | 9.2 TS2M0 | |
Windows Vista | 4.2 | | 9.2 TS2M0 | |
64-bit Enabled AIX | 4.2 | | 9.2 TS2M0 | |
64-bit Enabled Solaris | 4.2 | | 9.2 TS2M0 | |
HP-UX IPF | 4.2 | | 9.2 TS2M0 | |
Linux for x64 | 4.2 | | 9.2 TS2M0 | |
Solaris for x64 | 4.2 | | 9.2 TS2M0 | |