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