public frmDeliveryReport(DataTable _listBook, CCustomerDTO _customerObject, String _deliveryNoteId, decimal _totalAmount, decimal _totalQuantity) { InitializeComponent(); rptDeliveryNote _rptDeliveryNote = new rptDeliveryNote(); _rptDeliveryNote.LoadDataToReport(_customerObject.tenKhachHang, _customerObject.diaChi, _totalAmount.ToString(), _totalQuantity.ToString(), _deliveryNoteId, _customerObject.Email, _customerObject.soDienThoai); _rptDeliveryNote.DataSource = _listBook; docDeliveryNoteView.PrintingSystem = _rptDeliveryNote.PrintingSystem; _rptDeliveryNote.CreateDocument(); }
private void simpleButton1_Click(object sender, EventArgs e) { try { documentViewer1.PrintingSystem = null; rptDeliveryNote _rptDeliveryNote = new rptDeliveryNote(); sprptDeliveryNoteTableAdapter.Fill(dsDeliveryNote.sprptDeliveryNote, gridLookUpEdit1.EditValue.ToString(), AppConstant.CompCode); _rptDeliveryNote.DataSource = dsDeliveryNote.sprptDeliveryNote; _rptDeliveryNote.DataSourceSchema = dsDeliveryNote.sprptDeliveryNote.DataSet.GetXmlSchema(); _rptDeliveryNote.DataMember = "sprptDeliveryNote"; _rptDeliveryNote.CreateDocument(); this.documentViewer1.DocumentSource = _rptDeliveryNote; } catch (Exception) { MessageBox.Show("Sorry! There are no records for specified parameters."); } }