0

Print document from browser.

asked 2011-06-30 14:30:04 +0800

luisfernando gravatar image luisfernando
15

I'm new to the zk and would request help.
I wonder if it is to print a document, image
by zk.
If you did not know if someone is to print via browser, that is, I would export the document, zk-generated image to the browser and then print.

I hope to help me.

Luis Fernando

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2011-06-30 17:26:34 +0800

mjablonski gravatar image mjablonski
1284 3 5
http://www.jease.org/

You can use Clients.print(), here's an simple example:

<window title="Test" border="normal" width="200px">
 <button label="Print me" onClick="Clients.print();" />
</window>

Cheers, Maik

link publish delete flag offensive edit

answered 2011-06-30 22:25:07 +0800

jumroen gravatar image jumroen
9

updated 2011-06-30 23:06:06 +0800

To create report from JasperReport.

ByteArrayOutputStream bytesOutputStream = new ByteArrayOutputStream();
BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(bytesOutputStream);

JRExporter exporter = new net.sf.jasperreports.engine.export.JRPdfExporter();
exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, bufferedOutputStream);
exporter.exportReport();

InputStream mediais = new ByteArrayInputStream(bytesOutputStream.toByteArray());
bytesOutputStream.close();

AMedia amedia = new AMedia("SalesOrder" + salesOrder.getId() + ".pdf", "pdf", "application/pdf", mediais);

iframeReport.setContent(amedia);

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2011-06-30 14:30:04 +0800

Seen: 467 times

Last updated: Jun 30 '11

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More