private void Frm_SendDetail_Load(object sender, EventArgs e) { CpSendDetail detail = new CpSendDetail(); Invoice invoice = new Invoice(); if (this.m_SendId.Trim() != "") { DataSet set = invoice.PrintSendList(this.m_SendId); detail.SetDataSource(set); this.crv_Send.ReportSource=detail; } }
public void PrintSendDetail() { try { CpSendDetail detail = new CpSendDetail(); Invoice invoice = new Invoice(); if (this.m_SendId.Trim() != "") { DataSet set = invoice.PrintSendList(this.m_SendId); detail.SetDataSource(set); } detail.PrintOptions.PrinterName=Invoice.GetSendListPrinter(); detail.PrintToPrinter(1, true, 1, 0x1869f); } catch (Exception exception) { MessageBox.Show("打印时发生错误" + '\n' + exception.Message, "打印送货单明细", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }