The University of St. Thomas

Basic Report Structure

All reports have two components, a layout component that defines the report appearance, and a query component that defines report data.

Layout

A layout is a set of pages that defines the appearance and formatting of a report. When you design the layout of a report, you

  • present the data in a meaningful way by using lists, crosstabs, and charts
  • give the report the appearance you want by adding formatting, such as borders, color, images, and page numbers
  • specify how the data flows from one page to the next

Pages

Pages are containers for the layout objects that you use to build a report. A page is made up of the following mandatory and optional components:

  • page header (optional)
  • page body (mandatory)
  • page footer (optional)

Objects

You add layout objects to a page when you create a report. Below are objects that you will use often when building reports in Cognos Report Studio:

  • list
    Add a list to show data in rows and columns.
  • crosstab
    Add a crosstab to show data in a grid, with dimensions along the rows and columns, and measures in the cells or intersection points.
  • chart
    Add a chart to show data in a graphical format.
  • repeater
    Add a repeater to show each instance of a certain column or query item in a separate frame.
  • text
    Add a text item to show textual information.
  • block
    Add a block to hold text or other information. Blocks are often used to lay out horizontal bands of information.
  • table
    Add a table to arrange or align layout objects in a left to right, top to bottom fashion.

Queries

Queries determine what data items appear in the report. Sometimes you want detail rows of data, which you obtain by using a simple SELECT statement. Other times you must calculate totals or averages using aggregate functions and grouped columns, or must apply filters to show only the data you want.

Cognos Report Studio automatically creates the queries you need as you build reports. However, you can modify these queries or create your own custom queries to get the results you want.


Working with Objects

You build reports by adding objects and manipulating them to obtain the results you want. To understand how to work with objects in Cognos Report Studio, you must be familiar with the following concepts:

  • object types
  • objects as containers
  • locking and unlocking objects
  • hierarchy of objects

For additional information about Cognos Report Studio Object see  Report Studio Object and Property Reference or Cognos Report Studio Objects

  

Object Types

In Cognos Report Studio, layout objects are either inline or block. You can insert other objects on the same line as an inline object, but not on the same line as a block object. When you insert an object to the left or to the right of a block object, the object appears on the line above or below the block object respectively. Examples of inline objects include graphics and text items. Examples of block objects include any report type (list, crosstab, or chart) and tables.

Objects as Containers

Objects, such as tables, blocks, and any report frame, are containers in which you can insert other objects. For example, you can insert a list in one cell of a table and a chart in another.

Tip:

You can also nest objects to create a sophisticated layout. For example, you can insert a table in a cell of another table.

Locking and Unlocking Objects

To manipulate the contents of some objects, you must first unlock the object. For example, you have a list that contains the column Product Name. You want to insert a graphic inside the Product Name column to show an image of each product. Unlocking the list allows you to insert the image object inside a list column.

Tip:

From the Structure menu, click Lock Page Objects. Toggling this menu item locks and unlocks all layout objects in a report. However, this setting is not saved with the report.

Hierarchy of Objects

In Cognos Report Studio, objects are organized hierarchically. For example, a list contains list columns, and each list column contains a text item, which is the name of the inserted query item.

The hierarchy of objects is useful to remember when you apply formatting because formatting is applied to the child objects of the object. For example, you can specify that all list column titles in a list have red as the background color. The formatting is automatically applied to any new columns you add to the list, since the formatting is applied to the list and is therefore applied to the objects in the list.

Tip:

Select a column title in the list, and in the Properties pane, click the select ancestor button and click List Column Titles. Then specify the background color you want in the Background Color property

Inserting Other Objects

In addition to text and images, the Toolbox tab in the Insertable Objects pane contains other objects that you can add to a report. To add an object, drag or double-click it from the Toolbox tab.

Object Description
Calculation Adds a calculated column.
Block Adds an empty block, a container in which you can insert other objects.  This is useful for controlling where objects appear.
Table Adds a table, a container in which you can insert other objects.  This is useful for controlling where objects appear.
Hyperlink Adds a hyperlink so that users can jump to another place, such as a Web site.
Row Number Numbers each row of data returned when the report is run.
HTML Item

Add a a container in which you can insert HTML code, such as a link to a multimedia file.

Note:

  HTML items appear only when you run the report in HTML format.

Layout Component Reference Adds a reference to another object.  Useful when you want to reuse an object.
Conditional Block List Adds an empty block that you can use for conditional formatting.
Field Set Adds an empty block that has a caption.  This is similar to the Block object, but with a caption.
Hyperlink Button Adds a hyperlink in the form of a button.


Cognos Report Studio Properties Pane
 

The Properties pane lists the properties that you can set for objects and data items within your report.  You can obtain additional information about a property by selecting it and clicking F1.

Tip: View a description of the currently selected property at the bottom of the pane. From the View menu, click Property Descriptions.

Aggregate Function

Specifies the type of aggregation to apply. The Automatic setting means that the application groups or aggregates based on the data type. The Aggregate setting means that any setting found in the model will be used to determine the type of aggregation.

When set to Aggregate, the query item determines the aggregation that occurs. If the query item is defined by a calculation, then the data type determines the aggregation. If the query item refers to only one query item in the model, then the aggregation defined for that model item is used. If that model item has no aggregation defined, then its data type determines the aggregation.

When set to Automatic, if the data type of the query item is numeric, the query item is summarized. If the data type is non-numeric, the query item is grouped. If the query item refers to only one query item in the model, then the aggregation defined for that model item is used.

The aggregate function in the properties pane performs the aggregation (i.e. sum) according to the grouping levels within the report.  For better control or to aggregate on at a different level perform the aggregation on the data item itself and set the property in the pane to None.

Auto Group & Summarize

Specifies whether or not the application will apply suggested aggregate functions to aggregate data items and group all non-aggregate data items, producing groups and summary rows. If this is set to No, detail rows will be rendered.

Cross Product Allowed

Specifies whether or not the query will be allowed to run if there is a cross join between database tables. This type of query generates a result set that includes all possible unique combinations of values from the first and second table. Default - Deny.

Generated SQL

Displays the generated SQL.

Multi-Select

Specifies whether or not the control allows selection of multiple values. Note that an associated parameterized filter expression will override this object's setting. If you edit this property, but are not getting the expected results, check the associated expression for the presence of an operator that specifies how many items can be selected. Examples of multiple selection operators are "in" and "not in"; examples of single selection operators are "=", "<" and ">".

For example, if you used the prompt wizard to create a parameterized filter expression, and selected one of the operators that specify selection rules, changing the value of this property is not sufficient to change this restriction. You must also edit the filter's expression to remove the offending operator.

To edit a filter expression, you must select the filter, which is accessible from the Query view, using the Explorer bar.

Required

Specifies whether the prompt is required or optional. If this property is set to required, the prompt must have a value entered before the report can be run. Note that the associated parameterized filter's setting for this property will override this object's setting. If you edit this property, but are not getting the expected results, check the associated filter's setting for the Required property.

For example, if you created this prompt control with the prompt wizard, and set the associated parameterized filter to be optional, changing the value of this property is not sufficient to change this setting. You must also edit the filter's Required property to match the setting for this object's Required property.

To edit a filter expression, you must select the filter, which is accessible from the Query view, using the Explorer bar.