Problem with print [message #136954] |
Tue, 28 February 2006 07:33  |
Eclipse User |
|
|
|
Originally posted by: huqiao.mail.huptt.zj.cn
IN the ToolbarFragment.jsp I only found three button such as
"TITLE="<%= Resources.getString( "birt.viewer.toolbar.toc" )%>"
CLASS="birtviewer_clickable">
TITLE="<%= Resources.getString( "birt.viewer.toolbar.export" )%>"
CLASS="birtviewer_clickable">
TITLE="<%= Resources.getString( "birt.viewer.toolbar.parameter" )%>"
CLASS="birtviewer_clickable">"
I couldn't find the print button!
|
|
|
|
|
Re: Problem with print [message #137597 is a reply to message #137176] |
Wed, 01 March 2006 10:38   |
Eclipse User |
|
|
|
Originally posted by: vladperl.semanticprogrammer.org
"Holger" <Holger.Buchner@XXXXXXX.de> wrote in message
news:3310726e4a664358038aab84d52272db$1@www.eclipse.org...
> Hello hzjia,
>
> the print-button was lost in the JSP template for the report-viewer from
> BIRT RC2 to BIRT 2.0.
> You can just add the "print" button with the call of the PDF-rendition by
> adding it to the section You've shown in Your email:
>
> Just add the "Print" Button in the ToolbarFragment.jsp:
>
> <TR><TD></TD></TR>
> <TR>
> <TD WIDTH="6px"/>
> <TD WIDTH="15px">
> <A HREF="<%= pdfUrl %>" TARGET="_blank">
> <IMG NAME='print' SRC="images/iv/Print.gif"
> TITLE="<%= Resources.getString( "birt.viewer.toolbar.print" )%>"
> CLASS="birtviewer_clickable">
> </A>
> </TD>
> <TD WIDTH="6px"/>
> <TD WIDTH="15px">
> <IMG NAME='toc' SRC="images/iv/Toc.gif"
> TITLE="<%= Resources.getString( "birt.viewer.toolbar.toc" )%>"
> CLASS="birtviewer_clickable">
> </TD>
> <TD WIDTH="6px"/>
> <TD WIDTH="15px">
> <IMG NAME='parameter' SRC="images/iv/ChangeParameter.gif"
> TITLE="<%= Resources.getString( "birt.viewer.toolbar.parameter" )%>"
> CLASS="birtviewer_clickable">
> </TD>
> <TD WIDTH="6px"/>
> <TD WIDTH="15px">
> <IMG NAME='export' SRC="images/iv/ExportData.gif"
> TITLE="<%= Resources.getString( "birt.viewer.toolbar.export" )%>"
> CLASS="birtviewer_clickable">
> </TD>
> <TD ALIGN='right'>
> </TD>
> </TR>
>
> Then the "print" Button will be available again.
It's not enough because if you changed values of parameters on print you
will get result with olad values of parameters.
To work out this problem you need make the following changes:
ToolbarFragment.jsp
<%
String htmlUrl = request.getContextPath( ) + "/run?"
+ ParameterAccessor.getEncodedQueryString( request,
ParameterAccessor.PARAM_FORMAT, ParameterAccessor.PARAM_FORMAT_HTML );
String pdfUrl = request.getContextPath( ) + "/run?"
+ ParameterAccessor.getEncodedQueryString( request,
ParameterAccessor.PARAM_FORMAT, ParameterAccessor.PARAM_FORMAT_PDF );
%>
............................................................
<TD ALIGN='right'>
<A ID="print_html" HREF="<%=htmlUrl%>" TARGET="_blank">
<IMG SRC="images/PrintHTML.gif"
TITLE="<%= Resources.getString( "birt.viewer.toolbar.print" )%>" BORDER="0">
</A>
</TD>
<TD ALIGN='right' width="30px">
<A ID="print_pdf" HREF="<%=pdfUrl%>" TARGET="_blank">
<IMG SRC="images/PrintPDF.gif"
TITLE="<%= Resources.getString( "birt.viewer.toolbar.print" )%>" BORDER="0">
</A>
</TD>
BirtParameterDialog.js
__okPress : function( )
{
if( birtParameterDialog.collect_parameter( ) )
{
birtEventDispatcher.broadcastEvent( birtEvent.__E_CHANGE_PARAMETER );
this.__updatePrintLinks();
this.__l_hide( );
}
},
/**
* Patch for print links update :)
*/
__updatePrintLinks : function()
{
var strParams = "";
if (this.__parameter)
{
for (var i=0; i < this.__parameter.length; i++)
{
strParams += "&" + this.__parameter[i].name + "=";
strParams += this.__parameter[i].value;
}
}
if (this.__cascadingParameter)
{
for (var j=0; j < this.__cascadingParameter.length; j++)
{
for (var k=0; k < this.__cascadingParameter[j].length; k++)
{
strParams += "&" + this.__cascadingParameter[j][k].name + "=";
strParams += this.__cascadingParameter[j][k].value;
}
}
}
strHtmlUrl = $('print_html').href;
strUrlBase = strHtmlUrl.substring(0, strHtmlUrl.indexOf("&"));
$('print_html').href = strUrlBase + strParams + "&__format=html";
$('print_pdf').href = strUrlBase + strParams + "&__format=pdf";
},
After changes you will able to print in pdf and html.
Let me know in any case how it work for you.
If everything will work fine I will send that patch to the Birt team (there
is bug on this problem).
Good luck,
Vladimir
|
|
|
|
|
|
|
|
|
|
Re: Problem with print [message #139343 is a reply to message #139323] |
Sat, 04 March 2006 23:03  |
Eclipse User |
|
|
|
Holger wrote:
> Dear all:
> in BIRT 2.0 RC2, the print button was integrated in the report viewer and
> disappeared in BIRT 2.0. I transfered the some changes from RC2 to BIRT
> 2.0 using Winmerge. I'm not sure what other changes in addition to the
> changes in the toolbar_fragment were made.
There is a problem with implementation printing in Birt 2.0 RC2.
Check out:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=123854
You don't have the problem described in the bug?
Best regards,
Vladimir
|
|
|
Powered by
FUDForum. Page generated in 0.12263 seconds