private void btnRefreshStockCard_Click(object sender, EventArgs e) { if (dxStockCardValiation.Validate()) { // Bind the stock card. var dataRow = (DataRowView)lkStockArchivePeriod.GetSelectedDataRow(); StockCardReport report; if (chkStockCardArchive.Checked && dataRow != null) { report = ReportingReportFactory.CreateStockCard(Convert.ToInt32(lkStockCardActivity.EditValue), ItemID, Convert.ToInt32(lkStockCardUnit.EditValue), Convert.ToInt32(lkStockCardWarehouse.EditValue), Convert.ToInt32(lkStockCardManufacturer.EditValue), Convert.ToDateTime(dataRow["StartDate"]), Convert.ToDateTime(dataRow["EndDate"])); } else { report = ReportingReportFactory.CreateStockCard(Convert.ToInt32(lkStockCardActivity.EditValue), ItemID, Convert.ToInt32(lkStockCardUnit.EditValue), Convert.ToInt32(lkStockCardWarehouse.EditValue), Convert.ToInt32(lkStockCardManufacturer.EditValue)); } stockCardReport = report; printStockCard.PrintingSystem = report.PrintingSystem; report.PrintingSystem.ExecCommand(DevExpress.XtraPrinting.PrintingSystemCommand.ZoomToPageWidth, null); // Generate the report's print document. report.CreateDocument(); } }
private void lkBinCardWarehouse_EditValueChanged(object sender, EventArgs e) { if (_UnitID.HasValue && lkBinCardWarehouse.EditValue != null) { BinCardReport report = ReportingReportFactory.CreateBinCard(_StoreID, _ItemID, _UnitID.Value, Convert.ToInt32(lkBinCardWarehouse.EditValue)); printBinCard.PrintingSystem = report.PrintingSystem; report.PrintingSystem.ExecCommand(DevExpress.XtraPrinting.PrintingSystemCommand.ZoomToPageWidth, null); binCardReport = report; // Generate the report's print document. report.CreateDocument(); } }