Button types for Cognos

On a site I found various types for creating buttons on your cognos report:

PDF Button:

<input type=’Button’ value=”Report in PDF” onclick=”javascript:gCognosViewer.getRV().viewReport(‘PDF’)”>

CSV Button:

<input type=’Button’ value=”Report in CSV” onclick=”javascript:gCognosViewer.getRV().viewReport(‘CSV’)”>

XML Button:

<input type=’Button’ value=”Report in XML” onclick=”javascript:gCognosViewer.getRV().viewReport(‘XML’)”>

Excel single Sheet:

<input type=’Button’ value=”Report in Single Excel Sheet” onclick=”javascript:gCognosViewer.getRV().viewReport(‘singleXLS’)”>

Active Report button:

<input type=’Button’ value=”Report in Active Report” onclick=”javascript:gCognosViewer.getRV().viewReport(‘MHT’)”>

Excel 2007 Button:

<input type=’Button’ value=”Report in Excel2007″ onclick=”javascript:gCognosViewer.getRV().viewReport(‘spreadsheetML’)”>

 

 

PDF button in report

I came across a solution to get a PDF button in the report.
Drag a HTML item into the report and put in the following script:
<html>
<head>
<script language=”javascript”>
function gotoPDF()
{var obj=document.all[‘OutputFormat’];
var value=”PDF”;
/* Below function passed the selected output format to the server */
window.onload(gCognosViewer.getRV().viewReport (value));
}
</script>
</head>
<body>
</body>
<button style=”background-color:white” onclick=”gotoPDF()”>Open in PDF</button>
Another option is to create a drill link to the report it self.