Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Automate printing a BIRT report directly to a printer(Automate printing a BIRT report directly to a printer)
Automate printing a BIRT report directly to a printer [message #899369] Tue, 31 July 2012 15:12 Go to next message
Brian McMahon is currently offline Brian McMahon
Messages: 8
Registered: July 2012
Location: University of Delaware
Junior Member
Hi:

I am new to BIRT.

We are using Birt within a websphere application in a Windows environment. We have a need to automate a BIRT report and have it sent directly to a printer on the server side. So far we have been able to automate the generating of the report to a file. But are having problems automating the sending of a report directly to a printer.

Is there a suggested way of doing this?


Thank you.
Re: Automate printing a BIRT report directly to a printer [message #899399 is a reply to message #899369] Tue, 31 July 2012 16:46 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Have you tried the &__action=print on the url?

Jason


On 7/31/2012 11:12 AM, Brian McMahon wrote:
> Hi:
>
> I am new to BIRT.
>
> We are using Birt within a websphere application in a Windows
> environment. We have a need to automate a BIRT report and have it sent
> directly to a printer on the server side. So far we have been able to
> automate the generating of the report to a file. But are having
> problems automating the sending of a report directly to a printer.
> Is there a suggested way of doing this?
>
>
> Thank you.
>
Re: Automate printing a BIRT report directly to a printer [message #899410 is a reply to message #899399] Tue, 31 July 2012 17:50 Go to previous messageGo to next message
Brian McMahon is currently offline Brian McMahon
Messages: 8
Registered: July 2012
Location: University of Delaware
Junior Member
Thank you for the quick reply.

I have not tried the &__action=print on the url, I will give that a try.

I will have to change the set up a little bit to do so.
Currently for testing, I am generating the report using the birt report engine api in a stand alone class.

Would there be an api, or a java based solution that would not involve the URL?
We would realy like to have the report to be generated and printed on the server side by a automated task running on the server.



Thanks


Re: Automate printing a BIRT report directly to a printer [message #899413 is a reply to message #899410] Tue, 31 July 2012 17:53 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

If that is the case why not just use the Java print services and output
the report in PS and send it to the printer directly?

Jason

On 7/31/2012 1:50 PM, Brian McMahon wrote:
> Thank you for the quick reply.
>
> I have not tried the &__action=print on the url, I will give that a try.
>
> I will have to change the set up a little bit to do so. Currently for
> testing, I am generating the report using the birt report engine api in
> a stand alone class.
> Would there be an api, or a java based solution that would not involve
> the URL?
> We would realy like to have the report to be generated and printed on
> the server side by a automated task running on the server.
>
>
>
> Thanks
>
>
>
Re: Automate printing a BIRT report directly to a printer [message #899420 is a reply to message #899413] Tue, 31 July 2012 18:29 Go to previous messageGo to next message
Brian McMahon is currently offline Brian McMahon
Messages: 8
Registered: July 2012
Location: University of Delaware
Junior Member

Yes, the PS option to the java print services seems to be exactly what I am looking for.

What would I use to generate a PS stream for sending to the java print stream?

I am currently playing with the PDFRenderOption class which produces a good looking PDF file, but just blank pages when sent to the java print services.

Thanks

Re: Automate printing a BIRT report directly to a printer [message #899610 is a reply to message #899420] Wed, 01 August 2012 14:50 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

BIRT has a postscript emitter. Have you tried setting up the render
options like:

HTMLRenderOption options = new HTMLRenderOption( );
options.setOutputFormat( "postscript" );

If you do not want to write the ps file to disk use the
options.setOutputStream method.

Jason


On 7/31/2012 2:29 PM, Brian McMahon wrote:
>
> Yes, the PS option to the java print services seems to be exactly what I
> am looking for.
> What would I use to generate a PS stream for sending to the java print
> stream?
>
> I am currently playing with the PDFRenderOption class which produces a
> good looking PDF file, but just blank pages when sent to the java print
> services.
>
> Thanks
>
>
Re: Automate printing a BIRT report directly to a printer [message #899684 is a reply to message #899610] Wed, 01 August 2012 20:09 Go to previous messageGo to next message
Brian McMahon is currently offline Brian McMahon
Messages: 8
Registered: July 2012
Location: University of Delaware
Junior Member

Jason:

Thank you very much for your guidence and quick responses.
They were very helpfull.

The report is now being sent directly to the printer without user intervention.

It seems to also work with using the RenderOptions class.

IRunAndRenderTask task = engine.createRunAndRenderTask(design);
RenderOption options = new RenderOption();
options.setOutputFormat("postscript");

task.setRenderOption(options);

Thank you.

Re: Automate printing a BIRT report directly to a printer [message #1005900 is a reply to message #899684] Tue, 29 January 2013 09:11 Go to previous messageGo to next message
suganya c is currently offline suganya c
Messages: 7
Registered: August 2012
Junior Member
how could i generate a PS stream for sending to the java print stream?
Can yu give me the code example?
Re: Automate printing a BIRT report directly to a printer [message #1006274 is a reply to message #1005900] Wed, 30 January 2013 16:23 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Have you tried setting up the render options like above but adding something like:

HTMLRenderOption options = new HTMLRenderOption( );
options.setOutputFormat( "postscript" );
ByteArrayOutputStream out = new ByteArrayOutputStream();
options.setOutputStream( out );
task.run();
task.close();
InputStream inputStream = new ByteArrayInputStream(( (ByteArrayOutputStream) out ).toByteArray( ) );
//setup your Printer
Printer printer = ....
PrintService service = printer.getService( );
synchronized ( service )
{
DocPrintJob job = service.createPrintJob( );
Doc doc = new SimpleDoc( inputStream,
DocFlavor.INPUT_STREAM.POSTSCRIPT, null );
job.print( doc, pas );
}

I have not tried this but hopefully it will help you. The above code used javax.print package.

Jason
Re: Automate printing a BIRT report directly to a printer [message #1095618 is a reply to message #1006274] Tue, 27 August 2013 09:48 Go to previous messageGo to next message
Rajani Gunda is currently offline Rajani Gunda
Messages: 2
Registered: February 2012
Junior Member
Hi,

Will anybody provide me javascript(in afterRender) example, to send report to printer?

Thanks,
Rajani
Re: Automate printing a BIRT report directly to a printer [message #1181150 is a reply to message #1095618] Mon, 11 November 2013 12:05 Go to previous message
rd w is currently offline rd w
Messages: 3
Registered: November 2013
Junior Member
I have a requirement to generate a report which reports data from 2 different regions.. Results of regions printed in a different letter head,

So my question is :
Is it possible to have a master report call two subreports, and for each sub-report 1 automatically send the report for print to a printer 1
and sub-report 2 to printer 2
Any help pls...


Previous Topic:Dynamic HTML Links
Next Topic:Websphere - Unable to determine the default workspace location
Goto Forum:
  


Current Time: Thu Oct 02 16:49:07 GMT 2014

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

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