Erweiterte Anpassung > Business Logic Customization > Report Generation > Reporting Input Page Customization
  
Reporting Input Page Customization
Objective
You want to provide a parameter input page for the reports in your Windchill Business Reporting (WBR) system.
Background
The Windchill Business Reporting (WBR) solution supports reports with parameters. Both Windchill and Cognos viewers provide a basic input page that is presented to users to gather parameter values when the report is executed. Often times this input page requires customization for a better end user experience. There are two basic approaches for customizing input pages, use a standard Windchill Java Server Page (JSP) or use Cognos report functionality. The Windchill JSP approach can be used from the Windchill or Cognos viewers. The Cognos approach can only be used with the Cognos viewer.
Scope/Applicability/Assumptions
This documentation assumes that the Windchill Business Reporting (WBR) solution (i.e. Cognos) has been successfully installed and configured. The Windchill instance name is referred to as <WindchillInstanceName>. The Cognos root URL is referred to as <WBRHomeURL>. Typically, if the WBR solution is installed on <WBRHost>, then the <WBRHomeURL> would be http://<WBRHost>/Cognos/cgi-bin/cognos.cgi. It is assumed that you can login to <WBRHomeURL> and you have sufficient Cognos privileges to view Windchill Data Source objects and create reports.
Assume you have access to the Windchill server JSP directory, <WindchillHome>/codebase/wtcore/jsp, to create the JSP input page <MyInputPage> in its associated sub-directory <MyInputPagePackage>.
Assume you have access rights to edit an existing Windchill Report object, <MyReport> in the Site context.
Solution
Construct and specify a custom input page for reports.
Procedure – Specifying Optional Parameters
Customization Points
Cognos reports that use Windchill Data Sources require every parameter value to be specified. However, a report can be more useful, if the user can optionally leave parameter values unspecified and the report ignores the related criteria or implicitly uses a suitable default. To achieve this behavior, it is possible to pass a parameter value consisting of a single space (“ “) and by making a single space the default value for the parameter in you input page, the user will not be required to enter anything into the parameter input field. When using this technique, you must ensure that the underlying Data Source will be able to properly handle the empty space values that are passed.
Procedure – Populating Cognos Components Using Data Sources
Cognos input pages can use Windchill Data Sources to populate components. For example, a list of Windchill Products could be displayed in a picker component. When this component is populated, it would dynamically retrieve Products from Windchill and show their display names. When the user selects the display name, the internal Windchill object ID can be passed as a parameter value input to the report.
Procedure – Specifying Extra Parameters
By default, only the Data Source parameters are included in the Cognos request from Windchill. This means that any hidden form fields that might otherwise seem like request parameters are stripped off from the http request sent to Cognos (via a HTTP redirect). However, additional parameters can be explicitly added by including a parameter named “extraReportParameters” which specifies a list of parameter names that will be included in the Cognos request. Assume you want to pass a parameter with name, “paramA” with value “valueA” that is not in the list of parameters for the report’s Data Source. The following is an example for specifying this.
type="hidden" name="paramA" value="valueA"/>
type="hidden" name="extraReportParameters" value="paramA"/>
Data Source
Also data source parameters can be excluded using the usual "parametersToOmit" request attribute. Note, this is a servlet request object attribute list not a parameter list. it was chosen for simplicity and ease of use.
Procedure – Specifying Parameters To Omit
By default, only the Data Source parameters are included in the Cognos request from Windchill. However, parameters can be explicitly excluded using the "parametersToOmit" request attribute. Note, this is a servlet request object attribute list. Assume you want to omit the parameter with name, “param1” that is in the list of parameters for the report’s Data Source. The following is an example for specifying this.
<%
request.setAttribute("parametersToOmit",
Arrays.asList("param1"));
%>
Limitations
None.
Sample Code
Examples of Usage in Windchill Code
All of the out-of-the-box reports use Windchill JSP input pages.
Related Websites
http://www.ibm.com/cognos/support