Sunday, January 29, 2012

Explaining Report Specification

Report Specification:

From Cognos point of view, when we say "Report", we are referring to a "Report Specification". When you create a report in Cognos, you are not storing the report output or data or even the query. 

Let me be clear; you can save the report output in cognos, but this is not what you typically do when you create a report. When you create and save a report what you are saving in your "Public Folder" or "My Folder" is an XML specification that contains details about the report.

The details include things like:
  • the package your report is associated with
  • the location where the report is stored
  • the location of the package
  • list of queries, query items, filter expressions etc.
These details are stored in plain text as an XML file.

For example, a blank report you save in the cognos portal will have the following specification:

<report xmlns="http://developer.cognos.com/schemas/report/6.0/" expressionLocale="en-us">
<modelPath>/content/folder[@name='Packages']/package[@name='Enterprise Data Warehouse']/model[@name='model']</modelPath>
<drillBehavior modelBasedDrillThru="true"/>
<layouts>
<layout>
<reportPages>
<page name="Page1">
<style>
<defaultStyles>
<defaultStyle refStyle="pg"/>
</defaultStyles>
</style>
<pageBody>
<style>
<defaultStyles>
<defaultStyle refStyle="pb"/>
</defaultStyles>
</style>
<contents/>
</pageBody>
</page>
</reportPages>
</layout>
</layouts>
<XMLAttributes><XMLAttribute name="RS_CreateExtendedDataItems" value="true" output="no"/><XMLAttribute name="listSeparator" value="," output="no"/></XMLAttributes></report>

You can see some of the details that I mentioned about above.  The report specification can be viewed in Report Studio by clicking the "XML" icon on the toolbar or by selecting "Copy Report to Clipboard" option from the Tools menu.

Any change you make inside report studio like adding a query item, changing the font to bold or adding a new table in the report page will be reflected in the report XML.  When you save the report, Cognos saves this specification in the content store.

Report Execution:
When a report is "Run" or executed, cognos generates the SQL from each of the queries in the report, passes the queries to the source database and formats the output according to your report layout. Note that all these happen when you execute the report and not when you save the report.

2 comments:

  1. Very Clear Explanation, Thank you very much

    ReplyDelete
  2. Good explanation..Plz keep posting!

    ReplyDelete