Rocket City Cognos User Group Workshop August 23, 2012 Jonathan McKnight Dynetics, Inc. Jonathan.mcknight@dynetics.com
Application Analyst at Dynetics, Inc. since 2007 Worked with Cognos products for ten years Impromptu Impromptu Web Reports Cognos 8 Cognos 10 Cognos BI system administrator Maintain system security Author reports Manage development and production environments jonathan.mcknight@dynetics.com
A template brands your reports. A template unifies your report environment. A template makes it easier on developers to create reports. Templates save time! Well-designed templates save redevelopment.
Create a new report Basic Method Add your company logo in the header Add appropriate company information in the footer Use the Convert to Template option to create the template. Advanced Method Create a new report using the basic method, but save the report instead of converting it to a template. Create another report. Use Layout Component References that point back to the first report
Pros Quick Simple Basic Template Good for companies with fewer reports Good for companies who won t make many company-wide updates Cons Won t automatically get updated Time consuming to change reports if template changes Pros Advanced Template Can change with your company s needs Changes propagate through all existing reports that use the template Single point of reference for all reports Cons Single point of reference for all reports Takes longer to set up More complex that a basic template
Open Report Studio Select a package (any package) If prompted, select Create New Choose Report Template
You should see something similar to this
To save space, use a table in the header instead of the blocks. Set the left and right columns to the same width, and the center column holds the report title.
Finish the report page by adding logos, a title area, and footer information. Create a template for each kind of report commonly used by your company.
Add a prompt page. Copy the header table from the report page for expediency. Go to File Save As and save the template in a location of your choice.
With the report template still open, go to Tools Show Specification This will open a box with showing the report s XML. Select and copy the entire XML.
You will paste the XML into a file on the Cognos web server. Find the templates.xml file. It should be located in a folder with a path similar to this under Program Files: \ibm\cognos\c10\webcontent\pat\res Make a copy of the file as a backup!
Open the file with notepad. Find <xmlfragment id= Report Templates> in the file and add the following lines below it. <template name= [Choose Template Name] > </template> Paste your report XML between the template tags. Save the file.
Add an image to be used to identify the template. The image(s) used must be 32x32 pixel gif or jpeg and must be placed in the following directory: \ibm\cognos\c10\webcontent\pat\images Find resources.xml in the same folder as the templates.xml file. \ibm\cognos\c10\webcontent\pat\res Make a copy of the file as a backup before you make any changes!
Find <listview id= New view= icon cliplabels= false > in resources.xml. Add a listitem (probably at the top of the list) using the following syntax: <listitem label= [LabelName] icon= [iconname] templatename= [templatename] /> Make sure the icon name and template name are exactly correct or it won t work! Save the file.
Creating a report template this way adds extra steps and is more work on the front end, but it can save hours of modification down the road. The key to creating advanced report templates is using Layout Component References. In this method, you will actually have two templates. Original report template Layout Component References template
This method allows you to make changes to your first template (or report), and they then propagate to all of the reports that use the Layout Component Reference. A Layout Component Reference is used to pass through a value from another place in a report or even from a different report.
Make sure the first template (or report) is accessible by all users. Otherwise they won t be able to see the referenced components. You can reference almost any element of a report. Blocks Tables Textboxes Images HTML Items Any element you want to reference must be given a name in the first template or report.
Drag a Layout Component Reference to the report. Select Another report and choose the location of your original template. Select the component you want to use and click OK. Repeat for all the elements you want in your dynamic template.
Once you have your report template finished, save it. Go back and repeat the steps from the basic method to add the template to your list of templates. (The steps are on slides 11-15.) Test to make sure it works correctly. Open the dynamic report template and check it. Make a change to the original report template and save the changes. Open the dynamic report template again and you should see the changes. You are done, and you have saved yourself a lot of work in the future! You re Done!
Adding a standard Report Template to IBM Cognos 10 http://www.youtube.com/watch?v=f4xol ws3sqw IBM Cognos 8 Report Studio Cookbook by Abhishek Sanghani http://www.amazon.com/ibm-cognos- Report-Studio- Cookbook/dp/1849680345/ Cognos 10 Report Studio User Guide http://www.maine.edu/pdf/reportstudio UserGuide.pdf IBM Cognos Business Intelligence V10.1 Handbook http://www.redbooks.ibm.com/redbooks/ pdfs/sg247912.pdf