|
Re: Automate printing a BIRT report directly to a printer [message #899399 is a reply to message #899369] |
Tue, 31 July 2012 16:46   |
|
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 #899413 is a reply to message #899410] |
Tue, 31 July 2012 17:53   |
|
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 #899610 is a reply to message #899420] |
Wed, 01 August 2012 14:50   |
|
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 #1006274 is a reply to message #1005900] |
Wed, 30 January 2013 16:23   |
|
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
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02410 seconds