Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
BIRT Viewer Toolkit - js downloadReport() help needed
richardcooper25
<p>Hi,</p><p> </p><p>I would like to embed only the Params page for a report, so, on click of a button in the browser page, the report could be downloaded directly in a specified format e.g. Excel.</p><p> </p><p>I am able to embed the Params page using:</p><pre class="_prettyXprint"><div class="wrapper-report-box" id='param-container' style='border-width: 0px; border-style: solid;'></div> <input type="button" class="btn" id="run" name="run" value="Run Viewer" onclick="processParameters()" style="visibility: hidden"><div class="wrapper-report-box" id='report-container' style='border-width: 0px; border-style: solid;'></div><script type='text/javascript'>function initReport() { console.log("in initReport()"); actuate.load('viewer'); actuate.load('parameter'); actuate.initialize( 'http://10.6.4.3:8104/birt-viewer-toolkit/',null, null,null, displayParams );}function displayParams(){ param = new actuate.Parameter( 'param-container' ); param.setReportName('/crm-mail-out.rptdesign'); param.submit( function () {this.run.style.visibility = 'visible';});}function processParameters() { param.downloadParameterValues(runReport);}</script></pre><p>Then on click of the button, the processParameters() method is called, which then calls runReport:</p><p> </p><p>(in my case below, the report gets embedded in the page, but I actually just want to open a download dialog window to save in Excel and not embed the report)</p><pre class="_prettyXprint">function runReport(paramValues) { var viewer = new actuate.Viewer( 'report-container' ); viewer.setReportDesign('/crm-mail-out.rptdesign'); viewer.setParameterValues(paramValues); var options = new actuate.viewer.UIOptions( ); viewer.setUIOptions( options ); viewer.setWidth(viewer.getClientWidth()-200); viewer.showDownloadReportDialog( ); // The following line (commented out) doesn't work: //viewer.downloadReport("xls", "1-5", null); viewer.submit(); }</pre><p>The method downloadReport() doesn't work in my case.</p><p> </p><p>What is the correct way to use that method? And how can I use it without embedding the report in the browser?</p><p> </p><p>Also, what should the second parameter be to download all pages in the report?</p><p> </p><p>Thanks,</p><p> </p><p>Cheers,</p><p> </p><p>Richard</p>
Find more posts tagged with
Comments
richardcooper25
<p>I'm ok now: I found the following post:</p><p> </p><p><a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/forum/index.php?/topic/23052-using-actuateviewerdownloadreport/'>http://developer.actuate.com/community/forum/index.php?/topic/23052-using-actuateviewerdownloadreport/</a></p>
;
mwilliams
Sorry for the delay. Glad you found a solution.