Erweiterte Anpassung > Business Logic Customization > Report Generation > Cognos Presentation Customization
  
Cognos Presentation Customization
Objective
You want to create a Cognos report that queries data from an existing Windchill Data Source.
Background
Cognos is a third party reporting tool that is integrated with Windchill. It exposes Windchill Data Source objects in Cognos that can be used in Cognos reports to retrieve data from Windchill. Cognos is used to format and present the data for your report.
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 will name your new report <MyReport> and it will use the <MyDataSource> object to retrieve data from Windchill. It is also assumed that you will be able to create a Report object in Windchill in the Site context.
The WBR solution provides several out-of-the-box Windchill Data Source objects. If custom Windchill Data Source objects are required for your report, see ReportTemplate Data Source Customization for more details.
Intended Outcome
The end result of this solution is the creation of your report in Cognos. A sample output of a report is shown below.
Solution
Use Cognos Report Studio to create a report using a Windchill Data Source.
Prerequisite knowledge
To achieve this objective, you need to have an understanding of the following:
Cognos Report Authoring
JMX Console Basic Usage
Solution Elements
Element
Type
Description
<MyDataSource> Cognos Data Source
Cognos Object
The Cognos object that is used to query data from Windchill.
<MyReport> Cognos Report
Cognos Object
The Cognos object for a report that contains the definition of the query and specifies the presentation formatting.
<MyReport> Windchill Report
Windchill Object
The Windchill object that is displayed to end users in the Windchill User Interface. It acts as a proxy to a corresponding Cognos Report object.
Procedures
This section contains detailed information about the following customization procedures:
Creating a Report.
Creating a Report in a non-Site context
Deleting a Report
Creating a Report
1. Login to Cognos using the <WBRHomeURL>.
2. Navigate to “Public Folders > Windchill”.
3. Launch “Report Studio”.
4. Select <MyDataSource> as the Data Source for the report. These appear in the “Insertable Objects” window under the “Source” tab.
5. Use Cognos Report Studio features to complete the report.
6. Save the report to top level “Public Folders > Windchill” folder as <MyReport>.
7. Verify the report in Cognos. Refresh the “Public Folders > Windchill” folder and the <MyReport> object should be listed. Use the “Run with options…” action to run the report.
8. Expose your report to Windchill. Launch Java Console from installed Windchill shortcuts. There are two ways to do this:
Connect to the Embedded Servlet Engine (based on Tomcat) JVM instance. Select reporting management bean from the MBeans tab, “com.ptc > Monitors > ReportingSystem”. From the Operations tab, click “exposeReports”.
Select the Refresh Reports List button in Windchill Site/Reports to refresh the page.
9. View the <MyReport> Report in Windchill. The object will be displayed in “Site > Reports” . Note that the “Ready For Use” column shows “No” for this object. This means that other users with read-only access will not see this report. The “Ready For Use” attribute can be used to limit report access to end users while the report is being developed.
10. Edit <MyReport> to make the Report accessible to end users. Select the Edit action, then Select Home for “Display Context(s)” and check the “Ready For Use” checkbox. Click OK to save these changes. <MyReport> will now be visible to all users with read access from both “Site > Report” and “Home > Reports”.
11. Verify the report in Windchill. Navigate to “Home > Reports” and Select the “View Report” action for the <MyReport> object.
Creating a Report in a non-site context
In the primary procedure above, the Cognos Report was created in the “Windchill” public folder in Cognos. This folder correlates to the Site context in Windchill and the Windchill Report object is created in this context. A variation of the primary procedure is to create the Cognos Report and correlated proxy Windchill Report in a non-Site context such as an organization. You will need to create a folder structure in Cognos that corresponds to the non-Site contexts that you wish to use in Windchill. For example, assume you have an organization <MyOrg> that contains a product <MyProduct> and you want to create a report, <MyProductReport>, in the <MyProduct> context.
Prior to following the above primary procedure steps, create the following folders in Cognos
1. Under the “Public Folders > Windchill” folder, create a folder with the name, “wt.inf.container.OrgContainer=<MyOrg>”.
2. Under the “Public Folders > Windchill > wt.inf.container.OrgContainer=<MyOrg>” folder, create a folder with the name, “wt.pdmlink.PDMLinkProduct =<MyProduct>”.
3. In step 6 of the above procedure, save the report to the “Public Folders > Windchill > wt.inf.container.OrgContainer=<MyOrg> > wt.pdmlink.PDMLinkProduct =<MyProduct>” folder as <MyProductReport>.
4. In step 6, save the report to the "Public Folders > Windchill > wt.inf.container.OrgContainer=<MyOrg> > wt.pdmlink.PDMLinkProduct =<MyProduct>" folder as <MyProductReport>.
5. After exposing the report in step 8, the Windchill Report will be displayed in "Product: <MyProduct> > Reports".
Deleting a Report
A report that is no longer needed can be removed from the system by deleting both the Cognos and Windchill Report objects. Assume you want to delete <MyReport>.
1. Use the Cognos UI to browse to <MyReport> in the “Public Folders > Windchill” folder (if it is a non-Site context report, then it will be in a sub-folder) and select the “Delete” action.
2. Then, use the WindchillUI to locate <MyReport> and select the “Delete” action.
* 
The Reports table supports a multiple row delete action if the Reports table is within a context and you have delete access rights for Windchill Report objects in that context.
Limitations
The Cognos report authoring capabilities are designed for many different types of Data Sources. The WBR integration uses XML Data Sources. These may have some limitations when compared to other types of Cognos Data Sources. In most cases, Cognos is able to implement the similar functionality for XML Data Sources, but there may be implications. For example, it is possible to use aggregate functions to summarize data, but this processing takes place in the Cognos server after all data has been received so this may cause performance and scalability issues.
Cognos Reports have a one-to-one association with the Windchill Report business object. This object implements the AccessControlled interface so that standard Windchill access control can be applied. Note that there is no access control concept of “execution” rights. If a user has “read” access, then that user is also able to execute the report. The out-of-the-box access control policy for Windchill Report objects is specified for the Site context which provides Read access for all. Other access control rules will apply to Report objects based on type inheritance. For example, the Report object extends WTObject so at the Site level, Full access is granted for Administrators.
Cognos Reports are subject to the Cognos server’s access control policies. When Cognos is deployed as part of WBR, the integration does not alter Cognos default access control permissions, users, or groups apart from configuring Cognos to share Windchill LDAP for authentication. Further alteration to the access control permissions, users, or groups in Cognos must be done via Cognos’ tools, i.e. via their UI or API which is described in the Cognos documentation. For a good overview, see the "Initial Security" chapter in the Cognos Administration and Security Guide.
* 
The FloatingPointWithUnits attribute value type is not supported by Cognos. For more information, refer to article CS000308408.
Sample Code
Examples of Usage in Windchill Code:
Windchill supports out-of-the-box reports for both the Windchill ProjectLink and Windchill PDMLink solutions. See the Basic Administration section in the Windchill Hilfe-Center for details. Directly modifying the associated objects is not supported.
Related Package/Class Javadoc
CognosIntegration module
com.ptc.windchill.cognos
Reporting module
com.ptc.windchill.enterprise.report
Related Customization Documentation
Cognos Help (http://<WBRHost>/Cognos/documentation/help_docs.html)
Related Windchill Documentation
Basic Administration
Specialized Administration
Related Websites
http://www.ibm.com/cognos/support