I would like to know if anyone has ever combined running a report and sending a report to email with one button.
To run the PDF I have this logic in one button.
<input type='Button' value="Open in PDF" onclick="javascript:gCognosViewer.getRV().viewReport('PDF')">
Then I have this logic to send Report by Email
One Html
<script>
function emailPage()
{
try {window['oCV'+'_THIS_'].getRV().SendReport(false);}
catch (err) {}
}
</script>
Second Html
<input type='Button' value = "Email Report"
onclick="emailPage()"
value="Email"
ACCESSKEY="e"
title="Keyboard shortcut: alt-e">
I have also tried using this logic to run the PDF.
<script>
CViewerManager.prototype.runPDF = function ()
{ var oReq = new ViewerDispatcherEntry(this.getCV());
oReq.addFormField("ui.action","render");
oReq.addFormField("run.outputFormat","PDF");
this.viewPDFInNewWindow(oReq);
style = "background-color:#cc2d30;width: 155px;height: 23px;border:none; color:#FFFFFF; font:bold";
};
</script>
<input type="button" onclick="window['oCV'+'_THIS_'].getRV().runPDF()" value="Open in PDF"/>
did you get this to work.. i have the same requirement as well
yes. 1st html item with this on my main prompt page
<script>
function nextPage() {
oCR.sendRequest(cognos.Report.Action.NEXT)
}
</script>
<a href="JavaScript:nextPage()">
Once I click the email report: this goes to the second prompt page with this html item on it
<script>
function autoRefresh() {
setTimeout(oCR.sendRequest(cognos.Report.Action.NEXT), 1000);
}
autoRefresh();
</script>
Hey, i wanted to send the report to a recipient also wanted to write prompt values in the email body. could you please share how you were able to send the report on a click of button. i mean the recipient and body.