COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: wbarry123 on 11 Nov 2010 01:56:27 PM

Title: Choose report output on prompt page
Post by: wbarry123 on 11 Nov 2010 01:56:27 PM
Report Studio 8.3
I am wanting to allow a consumer to choose the output of their report from a prompt page.  I am using the following script in a HTML item.  When I run the report it appears that the script is resetting the prompts already chosen.  Is there something I am doing wrong?

<html>
<head>
<script language="javascript">
function gotoUrl()
{
var obj=document.all['OutputFormat'];
window.onload(gCognosViewer.getRV().viewReport(obj.options[obj.selectedIndex].value));
}

</script>
</head>
<body>

<select name="OutputFormat" OnBlur="javascript:gotoUrl()">
<option value="HTML">HTML</option>
<option value="PDF">PDF</option>
<option value="spreadsheetML">Excel 2007</option>
<option value="singleXLS">Excel 2000 Single Sheet</option>
<option value="XLWA">Excel 2002</option>
<option value="XLS">Excel 2000</option>
<option value="CSV">Delimited text (CSV)</option>
<option value="XML">XML</option>
</select>

</body>
</html>
Title: Re: Choose report output on prompt page
Post by: wbarry123 on 11 Nov 2010 02:12:39 PM
If I create a seperate prompt page, place the HTML item on the new page and place the page first teh report works perfectly.  I want to have it on the main prompt page though (if possible).
Title: Re: Choose report output on prompt page
Post by: bvk.cognoise on 08 Mar 2011 01:18:43 AM
hi  ,



1st step:-
>create a report with any data items
eg:product line,product type,revenue
>save that report

2nd step:-
>open saved report
>go to page explorer,create new prompt page
>from insertable objects pane drag a text item into prompt page,enter text  as 'PDF' in that text item
>Drag another text item into that same  prompt page enter text as 'HTML' in that tex item
>do the same process to all formats like excel,csv,xml  etc......

3rd step
>then right click on first text item 'PDF' then click on drillthrough Defination
>drill through window will open
>click on new new drill through button in drill through window.
>under  target  tab
>click on report then select saved report(means the report which you saved  in 1st step) click ok
>under actions  change action to  'run report'
>under format change format to 'PDF' .click ok
>next again go to prompt page ,right click on 'HTML' text item click on drill through defination
>drill through window will open
>click on new new drill through button in drill through window.
>under  target  tab
>click on report then select saved report(means the report which you saved  in 1st step) click ok
>under actions  change action to  'run report'
>under format change format to 'HTML' .click ok
>repeat  same process to all Excel,csv,xml,html  text items  which you created before in prompt page.
>but  under  format change format to respected text items.


eg::       for excel dat item     ----- change  format  to 'excel'
              for to xml dat item   -----  change format to ' xml'
              for to csv dat item    -----  change format to  'csv'

it is very easy method.no need to use java or HTML.hope u understand
Title: Re: Choose report output on prompt page
Post by: barrysaab on 09 Mar 2011 11:07:49 AM
Thanks,Krish.