public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { CsrSaleOrder rpt = new CsrSaleOrder(); rpt.Site = this.Site; return(rpt); }
private void RefreshReportSale() { if (chbShowBenefit.Checked) { if (!UserService.AllowToPerform(Resources.PermissionViewSaleDetailReport)) { const string briefMsg = "អំពីសិទ្ឋិប្រើប្រាស់"; var detailMsg = Resources.MsgUserPermissionDeny; using (var frmMessageBox = new FrmExtendedMessageBox()) { frmMessageBox.BriefMsgStr = briefMsg; frmMessageBox.DetailMsgStr = detailMsg; frmMessageBox.IsCanceledOnly = true; frmMessageBox.ShowDialog(this); return; } } } else { if (!UserService.AllowToPerform(Resources.PermissionViewSaleReport)) { const string briefMsg = "អំពីសិទ្ឋិប្រើប្រាស់"; var detailMsg = Resources.MsgUserPermissionDeny; using (var frmMessageBox = new FrmExtendedMessageBox()) { frmMessageBox.BriefMsgStr = briefMsg; frmMessageBox.DetailMsgStr = detailMsg; frmMessageBox.IsCanceledOnly = true; frmMessageBox.ShowDialog(this); return; } } } var searchCriteria = new List<string> { "SaleOrderNumber IN (SELECT SaleOrderNumber FROM TSaleOrders WHERE SaleOrderTypeId = 0)", "SaleOrderDate BETWEEN CONVERT(DATETIME, '" + dtpStartDate.Value.ToString("dd/MM/yyyy", AppContext.CultureInfo) + "', 103) AND CONVERT(DATETIME, '" + dtpStopDate.Value.ToString("dd/MM/yyyy", AppContext.CultureInfo) + " 23:59', 103)" }; var saleList = _SaleOrderService.GetSaleHistories(searchCriteria); DataSet dtsModel = new DtsModels(); var propertyInfos = typeof (SaleOrderReport).GetProperties(); foreach (var objInstance in saleList) { var dataRow = dtsModel.Tables[1].NewRow(); foreach (var propertyInfo in propertyInfos) dataRow[propertyInfo.Name] = propertyInfo.GetValue(objInstance, null); dtsModel.Tables[1].Rows.Add(dataRow); } if (chbShowQuantity.Checked) { var rptSaleOrderQuantity = new CsrSaleOrderQuantity(); rptSaleOrderQuantity.SetDataSource(dtsModel); crvReport.ReportSource = rptSaleOrderQuantity; } else if(chbShowBenefit.Checked) { var rptSaleBenefit = new CsrSaleBenefit(); rptSaleBenefit.SetDataSource(dtsModel); crvReport.ReportSource = rptSaleBenefit; } else { var rptSaleOrder = new CsrSaleOrder(); rptSaleOrder.SetDataSource(dtsModel); crvReport.ReportSource = rptSaleOrder; } }
public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { CsrSaleOrder rpt = new CsrSaleOrder(); rpt.Site = this.Site; return rpt; }