Jump to content
Changes to the Jaspersoft community edition download ×

How to trigger Cash drawer using jasper reports


abdul_5

Recommended Posts

My Application using Jasper Reports to generate and print reports. Cash Drawer is connected to that POS Printer and that should be triggered on Print. Is there any settings I need to configure in Jasper Reports. Here is my Code sample which prints the bill.

PrintRequestAttributeSet printRequestAttributeSet = new HashPrintRequestAttributeSet();

printRequestAttributeSet.add(MediaSizeName.ISO_A4);

PrintServiceAttributeSet printServiceAttributeSet = new HashPrintServiceAttributeSet();

printServiceAttributeSet.add(new PrinterName(printerName, null));

JRPrintServiceExporter exporter = new JRPrintServiceExporter();

exporter.setExporterInput(new SimpleExporterInput(jasperPrint));

SimplePrintServiceExporterConfiguration configuration = new SimplePrintServiceExporterConfiguration();

configuration.setPrintRequestAttributeSet(printRequestAttributeSet);

configuration.setPrintServiceAttributeSet(printServiceAttributeSet);

configuration.setDisplayPageDialog(false);

exporter.setConfiguration(configuration);

exporter.exportReport();

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...