Hi,
I am trying to simulate a Navigation menu with the aid of a Cognos 8.3 Report studio report that has:
1. A vertical dropdown menu,with links to other reports (as menu items)
An Iframe
2. Each of the menu items(report links) when clicked,open the corresponding report in the Iframe.
I would like to create a "Download-to-excel" button above the navigation menu,which when clicked opens/saves the current IFrame report in a new window in excel/pdf formats..Any help in this regard is appreciated.
Thanks in advance.
JavaScript and possibly SDK comes to mind.
Thanks Suraj.I figured it out.Didn't require SDK!!!
I had to add an html element in the report and include the following code:
For Cognos 8.3 only:
<a href="#" onclick="oCV_NS_.getRV().viewReport('XLS');"><img src="/_images/xxx.gif" alt="Export to Excel"></a>
For CRN/Cognos 8/8.2:
<a href="#" onclick="return runInFormat('XLS');"><img src="/_images/xxx.gif" alt="Export to Excel"></a>
Note:'XLS' is an argument and can be replaced with 'PDF','CSV' etc.
Thanks for sharing... but the code just adds a button to export to excel which is already available on the top bar by default.
Did you get any solution of the drop down menu for other reports?
Yes.
I had to add a javascript function (runFormat(format)) and call it on the button click event. Hope this helps.
<script>
function runFormat(format) {
if(typeof(top.frames['IframeID'].document.forms[0]) == 'object')
{
var f = top.frames['IframeID'].document.forms[0];
top.frames['theiframe']['oCV'+f['cv.id'].value].getRV().viewReport(format);
}
else
{
alert('select a report first.');
}
}
</script>
i paste the code in html. report open in excel but the fillter condition not working properly
If I want to change the name of excel file. How can I do then?