How to trigger Cash drawer using jasper reports

0

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();

abdul_5's picture
Joined: Jan 10 2020 - 2:01am
Last seen: 1 month 1 week ago

0 Answers:

No answers yet
Feedback
randomness