Saturday, February 18, 2012

Rotate Text in Cognos 8 Report Studio

1. Create Blank container in report studio
2. From Toolbox, Drag HTML Item Object then drop into report page
3. Double click HTML Item object then write the below html script

<html>
<head>
<script language=javascript>
</script>
</head>
<body>
<div id="mydiv" style="height:333; width:333;filter='progid:DXImageTransform.Microsoft.BasicImage(rotation=4)'">
<center>
<font size=11>
Cognos 8 BI
</font>
</center>
</div>
</body>
</html>


Try:

rotation=4
rotation=2
rotation=3
rotaion=1

The way to hide the header and toolbar & show view report buttons in Report Viewer

In 8.4 if you want to hide the header and toolbar in the cognos viwer window, 
 
just follow the below steps:
 
1. open the report in report studio.
2. drag and drop a HTML item in the report
3.Double click and add the following script in the html item
<style>
 .mainHeader1
{
display: none;
}
 .mainViewerHeader3
{
 display: none;
 }
 </style>
4. Now run the report, the header and the toolbars will be disabled in the cognos viewr window.

Alternate Rows Blank in List : Report studio

1.Select the columns u need
2. Go to the query explorer and drag the new data item and write the expression
running-count ([PRODUCT_LINE_EN]) and validate
name it as alternate columns
3. Then go to the page explorer drag that data item.
4.  Select the whole list  in the properties pane under grouping and sorting drag that data item under group(overall).
5.Now select the list coloumn body style go to the structure menu->
Headers&footers->list headers & footers then it will opens a popup and check that dataitem footer.
6. Go to the page explorer and palce the text item to the left of that data item with the empty name and delete the data item.
7. Now run the report.

Handling Empty Reports

Can someone help me with the question below? How can we handle Empty reports other than using "No Data Contents" option in Report Studio? This question was posed to me in an interview.
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 List data container.

2. In the Properties pane, click the select ancestor button and click the List 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 

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.

Display Conditionally in 1st Header or Footer


Display Conditionally in 1st Header or Footer

There are times when you want to display something only on the first page of a report - typically in the header or the footer. This is easy to accomplish, but not necessarily obvious.

The key is to create a layout calculated field, and place it in the page header or page footer. 

For example:

Open a report in Report Studio.

Click the Toolbox tab in the Insertable Objects pane.
 
Drag a Layout Calculation to the page header or page footer. 

In the Report Expression dialog box, Expression Definition: field, type the following definition:

IF ( PageNumber( )=1 ) THEN
( 'This text only displays on the first page' )
ELSE 
( ' ' )

and click the OK button.
Run the report.

How to create one shared column title for two list columns in report header in cognos 8.4


A list report with multiple columns. How to create a column title put it on top of two column titles and make it look like in Excel spread sheet format? For example, Product as a column title, another two columns sub titles as Product Line and Product Type.
Resolving the problem
Use Create Header toolbar button to add a list or page header row. By default, all headers are displayed below the Column Titles; this can be changed by setting the "Column Title" property of the list ojbect to "At start of details". Now we can split the summary header then merge the columns header as we wish.
Steps:
  1. Create the list report with the fields required.

  2. Click any cell in the list.

  3. On the toolbar, click Create Header.

  4. Use the Ancestor control to select the list object.

  5. In the Properties pane, under General, locate the Column Titles property and set it to At start of details.

  6. To have the heading to appear on all pages, select the new summary row, click the Ancestor control, and select List Header. In the properties, select Pagination, in the resulting dialog, click Repeat every Page.

  7. Select the summary row in the report, and on the toolbar, click the Split Cell button. This will split the header row into its individual cells.

  8. To have more then one row, click Structure, and Insert List Row Cells Above or Below.

  9. Now, select any number of adjacent cells, and click Merge Cells to merge them.

  10. Add the desired text to the cell.