I use Java to create report with JasperReports. What i want to do is that user be able to print directly, without print dialog.
I create JasperPrint and I know name and model of my printer.
I have also looked in the sample here but could not figure out how.
I use Java 1.7 and latest JasperReports library.
Does anyone know how to do it?
public class PrintApp {
public static void print() {
JasperPrint jasperPrint = getJasperPrint();
String printername = AllPrinter.getDepartmentPrinter("Admin");
// where should i introduce my printer name to jasperreports?
JasperPrintManager.printReport(jasperPrint, false);
}
private static JasperPrint getJasperPrint() {
return JasperPrinterCreator.getJasperprint();
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…