Jump to content
Changes to the Jaspersoft community edition download ×

how to print report direct to printer?


Recommended Posts

By: Tiger - hntiger

how to print report direct to printer?

2002-12-17 22:47

Hi, all

In jasper report I have make pdf file and click print icon to print report. But I want to print report direct to printer. If you know please help me.

Thank you

 

 

By: Dejan - dnikolov

RE: how to print report direct to printer?

2002-12-17 23:02

Try like this:

 

Map parameters = new HashMap();

parameters.put("Datum",new java.util.Date());

parameters.put("ReportTitle","");

 

String home = new String(System.getProperty("user.home"));

String jasperFile = "pckJasper/plata/IsplatnaLista.jasper";

String jasperPrint=home.concat("/IsplatnaLista.jrprint");

 

JasperReport jasper = JasperManager.loadReport(jasperFile);

JasperManager.fillReportToFile(jasper,jasperPrint,parameters,conn);

JasperManager.printReport(jasperPrint,false);

 

But this show directly to printer, without preview.

 

 

 

By: Kees Kuip - keeskuip

RE: how to print report direct to printer?

2002-12-18 04:47

I need this functionality also.

 

It seems that your solution prints it to the default printer.

I have several printers which I have to use in a server

program. Is there a solution for this ?

 

Maybe there should be an API to change the PrinterJob ?

 

Kees.

 

 

 

By: Teodor Danciu - teodord

RE: how to print report direct to printer?

2002-12-18 05:09

 

Hi,

 

There is the JRPrintServiceExporter which uses

the Java Print Service API that comes with JDK1.4

ant lets look lookup network printers.

Check the "printservice" sample provided.

 

If this does not suit your needs, there is the

JRGraphics2DExporter that can help you create

your own exporter or utility class, to send output

to any printer you might want to. For this, you

can check the source code of the JRPrinterAWT class.

 

I hope this helps.

Teodor

 

 

 

By: Bernd Proissl - berndproissl

RE: how to print report direct to printer?

2002-12-18 11:08

may also:

https://sourceforge.net/forum/message.php?msg_id=1673995

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...