Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » PHP Integration - Printing(Printing just like from BIRT Web Viewer)
PHP Integration - Printing [message #730812] Thu, 29 September 2011 08:45 Go to next message
karvesh ghunsam is currently offline karvesh ghunsamFriend
Messages: 95
Registered: July 2011
Member
Dear Jason

I have been using BIRT integrated with php with no problem so far. For the moment, when it comes to printing, i have to export the report to pdf, download it and then send it to printer.

I was wondering if there is another way to send it for printing in one click just like in the birt report viewer?

Any help here would be the most welcomed

Thanking you in advance

Karvesh
Re: PHP Integration - Printing [message #730941 is a reply to message #730812] Thu, 29 September 2011 15:00 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Karvesh,

Do you mean the print on server button or the normal print button?

Jason

On 9/29/2011 4:45 AM, karvesh wrote:
> Dear Jason
>
> I have been using BIRT integrated with php with no problem so far. For
> the moment, when it comes to printing, i have to export the report to
> pdf, download it and then send it to printer.
> I was wondering if there is another way to send it for printing in one
> click just like in the birt report viewer?
> Any help here would be the most welcomed
>
> Thanking you in advance
>
> Karvesh
Re: PHP Integration - Printing [message #730955 is a reply to message #730941] Thu, 29 September 2011 15:30 Go to previous messageGo to next message
karvesh ghunsam is currently offline karvesh ghunsamFriend
Messages: 95
Registered: July 2011
Member
Dear Jason

I mean the normal print button.
I mean a way to print the report with all the page layout settings page by page instead of a single html flush

Thanks
Karvesh
Re: PHP Integration - Printing [message #731006 is a reply to message #730955] Thu, 29 September 2011 17:00 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Karvesh,

The Web Viewer essentially does the same thing except instead of
downloading it, it just renders to a byte array output stream, which it
then sends to some print utility classes to print it. Do you already
have code for sending it to the printer?

Jason

On 9/29/2011 11:30 AM, karvesh wrote:
> Dear Jason
>
> I mean the normal print button.
> I mean a way to print the report with all the page layout settings page
> by page instead of a single html flush
> Thanks
> Karvesh
Re: PHP Integration - Printing [message #731112 is a reply to message #731006] Fri, 30 September 2011 02:48 Go to previous messageGo to next message
karvesh ghunsam is currently offline karvesh ghunsamFriend
Messages: 95
Registered: July 2011
Member
Dear Jason

Currently i have a javascript function that simply pushes the iframe content (that is the html display of the report) to the printer. Unfortunately the formatting is poor and the page setup defined in the master page layout during design time (like page width, height, etc) are lost.

Is there a better way to do it? You mentioned something about a code.. Could you please hint me here?

Thanking you in advance

Karvesh
Re: PHP Integration - Printing [message #731296 is a reply to message #731112] Fri, 30 September 2011 14:27 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

The viewer does this using AJAX calls back to the server that retrieves
a pdf to print. Maybe you could use javascript to call php page like
the one below:

<?php
header("Content-type: application/pdf");
header("Content-Disposition: attachment; filename=downloaded.pdf");

define ("JAVA_HOSTS", "127.0.0.1:8080");
define ("JAVA_SERVLET", "/JavaBridge/JavaBridge.phpjavabridge");

require_once("java/Java.inc");

session_start();

$here = getcwd();

$ctx = java_context()->getServletContext();
$birtReportEngine =
java("org.eclipse.birt.php.birtengine.BirtEngine")->getBirtEngine($ctx);
java_context()->onShutdown(java("org.eclipse.birt.php.birtengine.BirtEngine")->getShutdownHook());


try{


$report =
$birtReportEngine->openReportDesign("${here}/TopNPercent.rptdesign");
$task = $birtReportEngine->createRunAndRenderTask($report);
$taskOptions = new
java("org.eclipse.birt.report.engine.api.PDFRenderOption");
$outputStream = new java("java.io.ByteArrayOutputStream");
$taskOptions->setOutputStream($outputStream);
$taskOptions->setOutputFormat("pdf");

$task->setRenderOption( $taskOptions );
$task->run();
$task->close();

} catch (JavaException $e) {
echo $e; //"Error Calling BIRT";

}

//echo $outputStream;
echo java_values($outputStream->toByteArray());



?>

But instead of echoing the pdf stream send it to the printer?

Jason

On 9/29/2011 10:48 PM, karvesh wrote:
> Dear Jason
>
> Currently i have a javascript function that simply pushes the iframe
> content (that is the html display of the report) to the printer.
> Unfortunately the formatting is poor and the page setup defined in the
> master page layout during design time (like page width, height, etc) are
> lost.
>
> Is there a better way to do it? You mentioned something about a code..
> Could you please hint me here?
>
> Thanking you in advance
>
> Karvesh
Re: PHP Integration - Printing [message #731314 is a reply to message #731296] Fri, 30 September 2011 15:40 Go to previous messageGo to next message
karvesh ghunsam is currently offline karvesh ghunsamFriend
Messages: 95
Registered: July 2011
Member
Dear Jason

Thanks for the reply. I understand now.. Will give it a try for sure
Thanks a lot Jason

Karvesh
Re: PHP Integration - Printing [message #731444 is a reply to message #731296] Sat, 01 October 2011 03:13 Go to previous messageGo to next message
karvesh ghunsam is currently offline karvesh ghunsamFriend
Messages: 95
Registered: July 2011
Member
Dear Jason

It is working now... thanks

I have noted that you have skipped the line of code:

$taskOptions->setOption("pdfRenderOption.pageOverflow", "pdfRenderOption.fitToPage");

I was wondering what these attributes are? Is there any more detailed documentation about them? I have tried to search about them but to no avail...

Could you please hint me where to find more information about them?

Thanks a lot
Karvesh
Re: PHP Integration - Printing [message #731925 is a reply to message #731444] Mon, 03 October 2011 13:53 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Currently they are only documented in the JavaDocs I believe.

Some of them are discussed on:
http://www.eclipse.org/birt/phoenix/project/notable3.7.php#jump_8
and:
http://www.eclipse.org/birt/phoenix/deploy/reportEngineAPI.php#irendertask

Jason



On 9/30/2011 11:13 PM, karvesh wrote:
> Dear Jason
>
> It is working now... thanks
>
> I have noted that you have skipped the line of code:
>
> $taskOptions->setOption("pdfRenderOption.pageOverflow",
> "pdfRenderOption.fitToPage");
>
> I was wondering what these attributes are? Is there any more detailed
> documentation about them? I have tried to search about them but to no
> avail...
>
> Could you please hint me where to find more information about them?
>
> Thanks a lot
> Karvesh
Re: PHP Integration - Printing [message #731928 is a reply to message #731444] Mon, 03 October 2011 13:53 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Currently they are only documented in the JavaDocs I believe.

Some of them are discussed on:
http://www.eclipse.org/birt/phoenix/project/notable3.7.php#jump_8
and:
http://www.eclipse.org/birt/phoenix/deploy/reportEngineAPI.php#irendertask

Jason



On 9/30/2011 11:13 PM, karvesh wrote:
> Dear Jason
>
> It is working now... thanks
>
> I have noted that you have skipped the line of code:
>
> $taskOptions->setOption("pdfRenderOption.pageOverflow",
> "pdfRenderOption.fitToPage");
>
> I was wondering what these attributes are? Is there any more detailed
> documentation about them? I have tried to search about them but to no
> avail...
>
> Could you please hint me where to find more information about them?
>
> Thanks a lot
> Karvesh
Previous Topic:Filter by more than one combination
Next Topic:Problem mapping WebService response?
Goto Forum:
  


Current Time: Sat Apr 20 03:16:55 GMT 2024

Powered by FUDForum. Page generated in 0.03633 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top