To use Cognos product documentation, you must enable JavaScript in your browser.

Creating a Report

When you create a report, you are actually creating a report specification. The report specification defines the queries and prompts that are used to retrieve data, as well as the layouts and styles used to present the data. For simplicity, the report specification is named the report.

Before creating a report, ensure that you have the planning information you need.

Creating a new report involves
      

specifying the package

      

choosing a report template

      

adding data items

      

saving the report

      

running the report

You can then format the report and manipulate the data that will appear in the report . For information about other tasks that are specific to a report type, see Types of Reports.

Specify the Package

Specify the package that will provide items for the report.

The packages that you use to generate reports are based on models that are created in the modeling tool, Framework Manager. A model is a set of related objects, such as query subjects, dimensions, filters, and calculations. When you open a package in Cognos 8, these model objects are visible in the left frame.

The package must be previously created and published to the Cognos Connection portal. For more information, see the Framework Manager User Guide.

Steps
  1. In the Cognos Connection Welcome page, click the Launch link.

    From the drop-down list, click Report Studio.

  2. In the Select a package dialog box, click the package you want to use.

  3. In the Welcome dialog box, choose whether to open a new or existing report or template:

Objects from the selected package, such as data items, appear on the Source tab of the Insertable Objects pane.

Tip: You can later change packages .

Refresh the Package

If the package that a report is using has changed, refresh it to ensure that you are working with the latest version.

Steps
  1. In the Insertable Objects pane, click the Source tab .

  2. Right-click its background and click Refresh.

Tip: You can also close and reopen the report to upgrade it to the latest version of the package.

Choose a Report Template

When creating a new report, choose a report template to get you started quickly. You can select a predefined template that is formatted as a particular report type , or you can open an existing report as a template.

Steps
  1. From the File menu, click New .

  2. If you want to change the package, click the ellipsis (...) button and click a different package.

  3. Choose a report template:

The report template appears in the report page. For more information about templates, see Creating Your Own Report Templates.

Add Data to a Report

Select the data items that you want to appear in the report.

If you frequently use items from different query subjects or dimensions in the same reports, ask your modeler to organize these items into a folder or model query subject and then to republish the relevant package. For example, if you use the product code item in sales reports, the modeler can create a folder that contains the product code item and the sales items you need.

Data Source Icons

Each object in the data source has a representative icon. You can insert all of the following objects in a report, except for packages and dimensions.

Icon

Object

 

Package, which contains the objects you can insert in a report.

 

Query subject, which represents a table in the database.

 

In relational data sources, query item, which represents a column of qualitative data in the database, such as product name or country.

In dimensional data sources, level attribute, which represents a property of a level.

 

A member is a unique item within a hierarchy. For example, Camping Equipment and 4 Man tent are members of the Products Hierarchy.

 

Dimension, which represents a broad grouping of descriptive data about a major aspect of a business, such as products, dates, or markets.

 

Hierarchy, which represents a collection of dimensional members organized into a tree structure.

 

Level, which is a set of members that have common attributes. For example, a geographical dimension might contain levels for country, region, and city.

Multiple levels can exist within a level hierarchy, beginning with the root level. The root level is the parent and rollup of all members in the first level. It is used to obtain a rollup of all values across the hierarchy and to provide a convenient point to start drilling.

For example, a Years level hierarchy may contain the following levels:

  • Root level Years

  • First level Year

  • Second level Quarter

  • Third level Month

 

Measure or fact, a query item that represents a column of quantitative data in the database, such as revenue or quantity.

 

Measures folder, which contains hierarchical measures.

 

Model filter.

 

A folder is used to organize data items. You cannot import a folder into your report.

Step
Tips

Customize Your Source Tree

When using dimensional data, you can customize how you see data in the source tree. You can select a metadata view with dimensions, hierarchies, levels, an optional members folder, and member properties.

Or you can select a members-oriented tree view, such as the one in Analysis Studio. This view allows you to add only members in your report.

Steps
  1. In the Insertable Objects pane, click the Source tab .

  2. Right-click anywhere in the pane and click Package Tree Settings.

  3. Select the options that you want and click OK.

Save a Report

Save your report to preserve the modifications you made.

Reports are saved to the Cognos 8 server. You can also save your report on your computer .

Steps
  1. From the File menu, click Save , or click Save As to save a copy of the report under a different name.

  2. If you are saving the report for the first time, specify where you want to save the report and type a file name.

    For information about setting up folders in Cognos Connection for your reports, see the Cognos Connection User Guide.

  3. Click Save.

Run a Report

Run your report to see the data that is retrieved. Save time by validating it first to check for errors.

You can also run a report or a group of reports in Cognos Connection. Furthermore, you can save report outputs to a file system. For more information, see the Administration and Security Guide.

You can specify not to render a report page if it does not contain any data .

If you run a report that uses functions or features not supported by the data source, an error message appears. We recommend that you periodically test your reports while you author them in Report Studio to ensure that you do not encounter multiple error messages when you run the report.

Steps
  1. Open the report that you want.

  2. If you want to clear parameters values stored on the Cognos 8 server, from the File menu, click Clear Parameter Values.

    Parameter values stored by the Cognos 8 server include signon, validation, and prompt information. For example, if you define two data source connections in Cognos Connection that point to the same data source, you will be prompted to choose one when you run a report. This information is stored so that you will not be prompted each time you run the report.

  3. From the Tools menu, click Validate Report .

    A message box appears indicating whether any errors were found in the report.

  4. If you require more detail from the validation process, revalidate the report by clicking Validate with Options, and do the following:

  5. If you encounter validation errors and want Report Studio to identify incorrect objects in your report, from the Tools menu, click Auto Correct.

    Report Studio provides a list of such objects, each of which you can then remove to successfully run your report.

  6. If you want to view only the tabular data, from the Run menu, click View Tabular Data .

    If the report contains multiple queries, you must first click an object, such as a list or crosstab, that uses the query for which you want to view the tabular data.

    Use this command to ensure that the right results appear. For example, you create a calculation and you want to ensure it is giving you the results you want.

    Tip: You can also view tabular data in Query Explorer , which is useful when you are building queries.

  7. If you want to set run options, from the Run menu, click Run Options.

    The default value is the value of the selected corresponding run option in Cognos Connection.

    The run options you set apply only to the current session. When you close Report Studio, the options return to the default settings.

  8. Change any values you want for the current session and click OK.

    Option

    Notes

    Format

    None.

    Paper size

    Specify only if the output format is PDF.

    Paper orientation

    Specify only if the output format is PDF.

    Data mode

    Specify how much data is returned. All Data returns all data. Limited Data limits the amount of data returned based on design mode filters defined in the package. No Data returns artificial data instead of actual data from the data source.

    For more information about design mode filters, see the Framework Manager User Guide.

    Language

    The content language sets the preferred language for the data, Cognos Viewer, dates, and so on.

    Rows per page

    Specifies the number of rows to appear on each page.

    A Rows Per Page property exists in the Properties pane for lists and crosstabs. If you specify a value for this property, it overrides the same-named run option. This property applies to both HTML and PDF outputs. For more information about this property, see Controlling the Rows Per Page for Multiple Containers in HTML and PDF.

    Prompt

    Select to be prompted for each prompt defined, unless the prompt is defined in a report page.

    If you clear the check box, you are prompted only if the report cannot run without user intervention. For example, if a report has a single parameterized filter that is optional, you are not prompted when you run the report.

  9. From the Run  menu, click one of the options to produce the report in the format you want.

    You can produce a report in HTML, PDF, CSV, various Excel formats, and XML. You cannot produce a report in CSV or XML format if you have more than one query defined in the report, unless the additional queries are used for prompts.

The report runs in Cognos Viewer. Once the report has finished running, you can run the report again in the same format or in a different format. If you run the report again in CSV or XLS format, the report will appear in a new browser window.

The options available in Cognos Viewer depend on the capabilities set by the administrator for each user. For more information, see the Administration and Security Guide.

Running a Report Against a Dimensional Data Source

You can cancel a report that is running against Microsoft SQL Server Analysis Services only during the initial portion of its execution. After this time, the report runs to completion.

The same behavior applies to SAP BW data sources.

In Framework Manager, you can also control the number of levels within a hierarchy from which members, or values, are extracted from the hierarchy to populate a tree prompt.

For SAP BW, you can reduce the number of hierarchy levels to limit the number of nodes by setting the SAP BW variable property trimHierarchyLevels to 1. This removes the lowest level from the hierarchy prior to creating the list of nodes.

Units of Measure Notation

When running a report against an SAP BW data source, units of measure are included in the same column as the data values, separated by one space. For example, Celsius and Fahrenheit notations are appended to the end of the value.

If you see an asterisk character (*), one of the following was detected:

This behavior occurs when you are using a Cognos cube as a data source.

This behavior also occurs for SAP BW data sources.

Unsupported SAP Variable Properties

Some SAP variable properties are not supported.

Exclusionary ranges appear as an inclusionary prompt.

Mandatory not initial appear as a mandatory prompt.

When using BEx to define variables in your SAP data source, avoid using exclusionary ranges and the mandatory not initial property.

Specify Not to Render a Page If It Does not Contain Data

You can specify not to render a report page if the page does not contain any data when the report is run.

Steps
  1. In the report page, click a data container.

  2. In the Properties pane, click the select ancestor button  and click the data container type.

    For example, if the data container is a list, click List.

  3. Set the Render Page when Empty property to No.

  4. Repeat steps 1 to 3 for all other data containers in the page as well as any table of contents objects .

When you run the report, if no data is produced in all data containers and table of contents objects in a page, the page is not rendered. The page is not rendered even if the page contains other objects, such as text items or images.

Controlling the Rows Per Page for Multiple Containers in HTML and PDF

If you have more than one data container in a report, such as a list and a crosstab, you can control how the report is rendered in HTML and PDF by setting the Rows Per Page property for each container.

For HTML output, the report property option Page break by data container for interactive HTML controls whether the default number of rows is rendered for each data container on each page.

Cognos 8 uses the following rules when rendering reports in HTML and PDF:

Producing a Report in CSV Format

Cognos 8 can produce reports in CSV format so you can open them in other applications, such as Microsoft Excel. Reports saved in CSV format

You can open reports saved in CSV format using Microsoft Excel, Microsoft Windows Wordpad, and Star Office. By default, reports produced in CSV format will appear in the application associated with the .csv file type.

You cannot produce the following in CSV format:

In Cognos Connection, you can configure the CSV output to suit your environment. For example, you can specify the character used to delimit fields. For more information, see the Administration and Security Guide.

Producing a Report in Excel Format

Cognos 8 can produce reports in Excel format. Three options are available:

The Excel 2000 format can be viewed with versions of Excel 2000 and later. It supports up to 65,536 rows and multiple sheets. The Excel 2000 format is only available in Cognos 8 when Cognos Application Firewall validation is disabled.

Excel 2000 single sheet format offers improved security. Excel 2000 may have cookies in the URLs to spreadsheets, which could be used to illegally impersonate a user. Excel 2000 single sheet format does not use outgoing URLs. However, there is a limit of 65,536 rows, and page breaks for multiple-author pages are ignored.

Excel 2002 format and Excel 2000 single sheet format also offer the following benefits:

The Cognos 8 full date format does not always appear correctly in Microsoft Excel 2000 if it is on a system with a regional setting other than English. This does not occur with Microsoft Excel 2002 or 2003 versions. To fix this, reapply the proper format in Excel.

Excel 2007 format renders report output in native Excel XML format, also known as XLSX, that provides a fast way to deliver native Excel spreadsheets to Microsoft Excel XP, Microsoft Excel 2003, and Microsoft Excel 2007. Users of Microsoft Excel XP and Microsoft Excel 2003 must install the Microsoft Office Compatibility Pack, which provides file open and save capabilities for the new format. The output is similar to other Excel formats, with the following exceptions:

Limitations exist when producing reports in XLS format. For more information, see Producing Reports in Microsoft Excel Format.

Producing a Report in XML Format

XML report outputs save the report data in a format that conforms to an internal schema, xmldata.xsd. You can find this schema file in c8_location/bin.

This format consists of a dataset element, which contains a metadata element and a data element. The metadata element contains the data item information in item elements. The data element contains all the row and value elements.

You can create models from reports and other data that conform to the xmldata.xsd schema. This is useful if you want to use a report as a data source for another report, or if you use a database that cannot be read by Framework Manager. In this case, export the data from the data source to an XML file, in conformance with the xmldata schema, and then open the XML file in Framework Manager.

For more information, see the Framework Manager User Guide.

You cannot produce the following in XML format: