COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Revathi_M on 29 Oct 2014 09:24:48 AM

Title: export to excel using button
Post by: Revathi_M on 29 Oct 2014 09:24:48 AM
anybody export help me

In My Report top of the report 5 drop down prompt and left side 3 radio prompt and one button(Export to excel)

and central report table and chart


when click "export to excel" button export only table and chart data but not dropdown prompt and radio but and button(export to excel)
i am using this HTML code:

<div>
<input type='Button' value="Export to Excel" onclick="javascript:gCognosViewer.getRV().viewReport('singleXLS')">
</div>

but export all data

please anybody help
Title: Re: export to excel using button
Post by: CognosAnalytics on 29 Oct 2014 12:06:37 PM
Hello Revathi_M,
That is expected behavior. You cannot show the prompt UIs in any other format other than HTML.

Cognos810
Title: Re: export to excel using button
Post by: jayatu on 30 Oct 2014 03:55:57 AM
Hi Revathi_M,

This is an expected behaviour, Prompts are available only in HTML format.

Although it is possible to display the selected values in place of the prompts.

Create a boolean Variable that is based on the ReportOutput() and set True for HTML

IF (  ReportOutput() = 'HTML' ) THEN
    ( 1 )
ELSE
    ( 0 )


Now create a Conditional Block and use this variable as Block Variable.

In the True block, keep your Prompt Objects.

In the False block, put report expressions instead i.e. ParamDisplayValue(promptName).

So, You will get the prompt controls when rendered in HTML, but just the values stored in the Parameters when rendered in PDF, Excel and other formats, which don't display Prompt Controls.

Jayatu