public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { CsrSaleReturn rpt = new CsrSaleReturn(); rpt.Site = this.Site; return(rpt); }
public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { CsrSaleReturn rpt = new CsrSaleReturn(); rpt.Site = this.Site; return rpt; }
private void RefreshReportReturn() { if (!UserService.AllowToPerform(Resources.PermissionViewReturnProductReport)) { 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 = 1)", "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 assessmentList = _SaleOrderService.GetSaleHistories(searchCriteria); DataSet dtsModel = new DtsModels(); var propertyInfos = typeof (SaleOrderReport).GetProperties(); foreach (var objInstance in assessmentList) { var dataRow = dtsModel.Tables[1].NewRow(); foreach (var propertyInfo in propertyInfos) dataRow[propertyInfo.Name] = propertyInfo.GetValue(objInstance, null); dtsModel.Tables[1].Rows.Add(dataRow); } var rptSaleReturn = new CsrSaleReturn(); rptSaleReturn.SetDataSource(dtsModel); crvReport.ReportSource = rptSaleReturn; }