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)
Custom Report Download Dialog
PrinceBabel
<p>Hi Team,</p>
<p> </p>
<p>Is there a way where we can customize download report dialog?</p>
<p> </p>
<p>In my report I am using <strong>myViewer.showReportDownloadDialog() </strong>to show all download options.</p>
<p>But my requirement is to show few options in that dialog box instead of all download options like I don't want xls , xlsx etc. options visible in that dialog box rest all options visible.</p>
<p> </p>
<p>Thanks in Advance!</p>
<p> </p>
Find more posts tagged with
Comments
Clement Wong
<p>In the file <strong>ExportReportDialogFragment.jsp</strong>, under ...<em>\birt\webcontent\birt\pages\dialog</em>, you'll find code similar to the following where the FORM SELECT options are built in the JSP.</p>
<p> </p>
<p>You can modify the logic here:</p>
<pre class="_prettyXprint">
<SELECT ID="exportFormat" NAME="format" CLASS="birtviewer_exportreport_dialog_select">
<%
ParameterAccessor.sortSupportedFormatsByDisplayName(supportedFormats);
for ( int i = 0; i < supportedFormats.length; i++ )
{
if ( !ParameterAccessor.PARAM_FORMAT_HTML.equalsIgnoreCase( supportedFormats[i] ) )
{
%>
<OPTION VALUE="<%= supportedFormats[i] %>"><%= ParameterAccessor.getOutputFormatLabel( supportedFormats[i] ) %></OPTION>
<%
}
}
%>
</SELECT>
</pre>
PrinceBabel
<p>Thanks Wong for you reply!</p>
<p> </p>
<p>Actually we do not have access to jsp files and changes we are doing in Actuate BIRT designer. Version 4.4</p>
<p> </p>
<p>Moreover the download options vary from report to report.</p>
<p>report1.rptdesign - hide XLSX, XLS show other options</p>
<p>report2.rptdesign - hide PPT format and show rest all options etc..</p>
<p>Is there any code which we can do in onContentUpdate() script?</p>
Clement Wong
<p>Oh, sorry I assumed open source BIRT. Since this is commercial BIRT, you're doing this in the Designer?</p>
<p> </p>
<p>Do you have an iHub?</p>
<p> </p>
<p>BTW, you can call me Clement.</p>
PrinceBabel
<p>Yes Clement we are doing this in designer .</p>
<p> </p>
<p>Yes we have iHub server.. version 3.1.1</p>
Clement Wong
<p>Oh, I think you meant <em>showDownloadReportDialog()</em>. </p>
<p> </p>
<p>It's possible, but not recommended to change files for the web viewer in the Designer.</p>
<p> </p>
<p>For Information Console, which is core product and also not recommended to change, you may want to look at the file <strong>feature42522.js</strong> under <em>...\iportal\iv\viewer</em>. Please make a backup before making changes.</p>
<p> </p>
<p>The .js is compressed, and you'll need to beautify it (for example, JSTool in Notepad++) to read it. Line 43 is where you'll want to start:</p>
<p> </p>
<p>The variable <strong>J</strong> is an object array of the format options available. Prior to line 43 is where you can remove options as needed.</p>
<pre class="_prettyXprint">
...
for (var H = 0; H < J.length; H++) {
var C = J[H].outputFormat;
if (C != "CSV" && C != "PSV" && C != "TSV") {
if (!L) {
...</pre>
<p>The report name, including the path will be available in <strong><span style="font-family:'courier new', courier, monospace;">this._consumer._reportDesign</span></strong>. So using that variable, you can present the corresponding available options.</p>
<p> </p>
<p>Before testing, you should first clear your browser's cache, or use a private / incognito window to see changes.</p>