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)
How to delete some option formats in export report dialog ?
Rojo
Hi, I have the birt into my java application, I'm using the <%@ taglib uri="/birt.tld" prefix="birt" %> to show my reports within the page, using the birt:viewer tag, like this:
<birt:viewer id="birtViewer" reportDesign="rpts/report.rptdesign"
pattern="frameset"
height="440"
width="980"
format="html">
<birt:param name="id" value="<%=id%>"/>
</birt:viewer>
Then, in the export format dialog, the user can select the formats:
Excel
PostScript
Pdf
Word
ppt
And I need to only show de pdf option, and eliminate the other formats (excel,word, ppt ).
Can somebody tell me what file I need to edit to delete that options ?
Thanks.
PsotS
Find more posts tagged with
Comments
Rojo
Because I only will permit the pdf format to export Report and print Report, I edit the files:<br />
<br />
webcontent/birt/pages/dialog/ExportReportDialogFragment.jsp<br />
and<br />
webcontent/birt/pages/dialog/PrintReportDialogFragment.jsp<br />
<br />
<br />
In the file ExportReportDialogFragment.jsp the line:<br />
<br />
String[] supportedFormats = ParameterAccessor.supportedFormats;<br />
<br />
store the supported formats (Excel, pdf, postscript,word, ppt)<br />
<br />
Then in the line:<br />
<br />
<SELECT ID="exportFormat" NAME="format" CLASS="birtviewer_exportreport_dialog_select"><br />
for ...<br />
<OPTION VALUE="<%= supportedFormats
%>"><%= ParameterAccessor.getOutputFormatLabel( supportedFormats
) %></OPTION> <br />
....<br />
</SELECT><br />
<br />
This code shows a list with the supported formats, because I Only need the pdf format, I comment some lines and add one, to only show the pdf option, something like this:<br />
<br />
<SELECT ID="exportFormat" NAME="format" CLASS="birtviewer_exportreport_dialog_select"><br />
<OPTION VALUE="<%= supportedFormats[2] %>"><%= ParameterAccessor.getOutputFormatLabel( supportedFormats[2] ) %></OPTION><br />
<br />
<!-- Commented lines --><br />
<%<br />
/* for ( int i = 0; i < supportedFormats.length; i++ )<br />
{<br />
if ( !ParameterAccessor.PARAM_FORMAT_HTML.equalsIgnoreCase( supportedFormats
) )<br />
{*/<br />
%><br />
<!-- <OPTION VALUE="<%//= supportedFormats
%>"><%//= ParameterAccessor.getOutputFormatLabel( supportedFormats
) %></OPTION> --><br />
<%<br />
// }<br />
//}<br />
%><br />
<br />
</SELECT><br />
<br />
<br />
Then I only add to the list, this option value:<br />
<br />
<OPTION VALUE="<%= supportedFormats[2] %>"><%= ParameterAccessor.getOutputFormatLabel( supportedFormats[2] ) %></OPTION><br />
<br />
the supportedFormats[2] is the pdf option.<br />
<br />
That's all.<br />
<br />
When The user try to print report, it shows two options, HTML and pdf, I only permit the pdf option editing the file:<br />
<br />
webcontent/birt/pages/dialog/PrintReportDialogFragment.jsp<br />
<br />
and commented the line:<br />
<!--<br />
<DIV><br />
<INPUT TYPE="radio" ID="printAsHTML" name="printFormat" CHECKED/><%//=BirtResources.getMessage( "birt.viewer.dialog.print.format.html" )%><br />
</DIV> --><br />
<br />
This way The user only can export and print as pdf format.<br />
<br />
Thanks.