我有表是名称 Mr_items 我需要当我选择任何我需要打印的项目时,在碧玉报告中按组打印到 it_print 列
item_sn | item_name | it_print
---------------------------------
1 | pepsi | drinks
2 | sandwiches | foods
3 | water | drinks
4 | burger | foods
我尝试通过此代码打印
///print invoice cashier
public void PrintInvoiceSection() throws JRException, IOException {
try {
/////////print///////////////////
HashMap parameters = new HashMap();
parameters.put("nameilll", cashier_name.getText().trim());
parameters.put("datevist", sysdate_invc.getText().trim());
parameters.put("timevist", systime_invc.getText().trim());
parameters.put("invoice_type", InvoiceType.getText());
parameters.put("invoiceno", inv_id);
parameters.put("cus_name", cusName.getText().trim());
parameters.put("cus_mobile", cusMobile.getText().trim());
parameters.put("cus_address", cusAddrss.getText());
parameters.put("inv_remark", customerBehestRemark.getText());
parameters.put("inv_remark", invoiceRemark.getText());
InputStream ul = getClass().getResourceAsStream("/printer/Printsection.jasper");
java.util.Vector collection = new java.util.Vector();
collection = new Vector(itemslist);
JasperPrint jasperPrint = JasperFillManager.fillReport(ul, parameters, new JRBeanCollectionDataSource(collection));
JasperViewer jv = new JasperViewer(jasperPrint, false);
jv.setVisible(false);
PrintReportToPrinterSection(jasperPrint);
} catch (JRException ex) {
Logger.getLogger(SalesinterfaceController.class.getName()).log(Level.SEVERE, null, ex);
}
}
我不能将它包含在 jasper 报告中,因为我不知道 jasper 的领域我是新手:)
HUWWW
相关分类