Please or Register to create posts and topics.

Direct Printing

I found this, but I'm not sure where to get the import files from

// Source - https://stackoverflow.com/q/29734265
// Posted by Door D Uthpala, modified by community. See post 'Timeline' for change history
// Retrieved 2026-03-04, License - CC BY-SA 3.0

JasperDesign jspDesign = JRXmlLoader.load(reportSource);
JasperReport jspReport = JasperCompileManager.compileReport(jspDesign);
JasperPrint  jspPrint  = JasperFillManager.fillReport(jspReport, params, datasource);
JRExporter   exporter  = new JRPrintServiceExporter();

JasperPrintManager.printReport(jspPrint, false); // Send to default printer?

====

I believe I have to get/download this file
jasperreports-8.2.0.jar

So I could import these files... not sure these are correct...
import net.sf.jasperreports.engine.JasperCompileManager;
import net.sf.jasperreports.engine.JasperExportManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;

No idea where to get it, as it seems all the CE files have been blanked on jaspersoft, sourceforge, and github

🙂 You have these already in your Jaspersoft Studio (Professional) Tool... "jasperreports-8.2.0.jar" is THE Jasperreports-Library, already integrated in Jasper Studio and/or you Jasperreports Server.

Of course, you should use the jasperreports version according to your environment (what ca be a bit difficult in the Professional environment, because they use nicely sounding higher version numbers there).

Should be clear, that for this solution you would need to run your report in an own Java Programm; that way is not usable in Jasper Studio or Jasperserver (at least not in the "Preview" or in Jasperserver without developing an own export channel).

Indeed, such a "direct printing" functionality has been added to the version 10 of Jasperserver (as far as I believe to remember having heard/read something like this).

What exactly are you planning to do?

THX+Greeetings,

Thomas

P.S: BTW, the Jasperreports Library is still Open Source, can be found here: https://github.com/Jaspersoft/jasperreports But as mentioned above, you won´t need that source code...

zkiwi34 has reacted to this post.
zkiwi34

What I am planning on doing is direct printing.
My Internal WebApp will take in a bunch of scanned codes, and then (without the rigmarole of creating a PDF) print directly to "the right" printer.

Anyhow, I don't run the professional, just the CE
6.2.0 for Studio
8.2.0 for Report Server

I've poked around but cannot find that jar or anything like the imports, that I think are needed

Hi zkiwi34,

You are talking about the imports

import net.sf.jasperreports.engine.JasperCompileManager;
import net.sf.jasperreports.engine.JasperExportManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;

right?

Those are indeed in jasperreports.jar If you are using the server 8.2.0, then you need version 6.x.x, the newest is 6.21.5 https://mvnrepository.com/artifact/net.sf.jasperreports/jasperreports/6.21.5. Or you could use the exact version 6.20.3 that's in the server, but the newer one should be compatible.

jasperman has reacted to this post.
jasperman