Showing posts with label Report Studio. Show all posts
Showing posts with label Report Studio. Show all posts

Friday, May 02, 2014

Page Break: Report Page1(containing List, Cross tab & Chart)

having list, cross tab, chart reports on single page and when we run the report, need to show list,cross tab, chart on different pages (each page).

----First Create 3 Queries: ListQuery,CrosstabQuery,Repeater Query
ListQuery: ProductLine,ProductType,Qty,DataItem1 (Expression: ‘A’)
CrosstabQuery: ProductLine,ProductType,Qty,DataItem1 (Expression: ‘B’)
Repeater/chart Query: ProductLine,ProductType,Qty ,DataItem1 (Expression: ‘C’)
----Again create Queries: AQuery, BQuery, CQuery
AQuery: DataItem1 (Expression: ‘A’)
BQuery: DataItem1 (Expression: ‘B’)
CQuery: DataItem1 (Expression: ‘C’)
-----Now Union (AQuery, BQuery, CQuery) with Query Operation properties=select projection List Property as Manual; Now rename Union Query as ABCQuery
----Now Select Entire Page1- Set Query - ABCQuery
----Now Add  Page Set then add Page1 Under Detail Pages;Set  Query – ABCQuery;Grouping & Sorting place Data Item1 into Groups
----Select the List –Properties: Master Detail Relationships (DataItem1 to DataItem1); column Titles (At Start of first details on page); Remove No Data Contents
----Select the Crosstab –Properties: Master Detail Relationships (DataItem1 to DataItem1); Remove No Data Contents
----Select the Repeater –Properties: Master Detail Relationships (DataItem1 to DataItem1); Properties – check the DataItem1 finally Add chart into Repeater  container.
Or
Chart : Properties: Master Detail Relationships (DataItem1 to DataItem1)

Wednesday, April 23, 2014

Tuesday, April 22, 2014

Default current Month and Current year on Value prompt:


Solution:
 
Pq_Date (Prompt Query):

d_Date_Month_Use: Expression: month([Date])

d_Date_Month_Display: Expression: left(monthname([Date]),3)

d_Date_Year_Display: Expression: year([Date])
 
d_Date_Month_Final_Use: Expression:

Case
When [d_Date_Month_Use] = month(current_date) then 0
Else([d_Date_Month_Use])
End

 
d_Date_year_Final_Use: Expression:

Case
When [d_Date_Year] = year(current_date) then 0
ELse([d_Date_Year])
End
-----------------------------------------------------------------------------
Now add 2 Drop down Prompts: (Month; year) :
Month: Drop down prompt(Value Prompt)
Use Value: d_Date_Month_Final_Use
Display Value: d_Date_Month_Display
Add Default Selections: 0
 
Year: Drop down prompt(Value Prompt)
Use Value: d_Date_year_Final_Use
Display Value: d_Date_Year_Display
Add Default Selections: 0

  -----------------------------------------------------------------------------------
Main Query— add filter:
([d_Date_Month_Final_Use] = ?P_ Month?) and ([d_Date_year_Final_Use] = ?P_ Year?
---------------------------------------------------------------------------------------

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

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.