public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { CsrDeposit rpt = new CsrDeposit(); rpt.Site = this.Site; return(rpt); }
private void RefreshReportDeposit(bool allDeposit) { if (!UserService.AllowToPerform(Resources.PermissionViewDepositReport)) { 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 = !allDeposit ? new List<string> { "(DepositDate 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)) ", "(AmountPaidInt < AmountSoldInt) ", "DepositNumber NOT IN (SELECT ReferenceNum FROM TDeposits WHERE ReferenceNum IS NOT NULL) " } : new List<string> { "(DepositDate 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 = _depositService.GetDepositHistories(searchCriteria, false); DataSet dtsModel = new DtsModels(); var propertyInfos = typeof(DepositReport).GetProperties(); foreach (var objInstance in assessmentList) { var dataRow = dtsModel.Tables[3].NewRow(); foreach (var propertyInfo in propertyInfos) dataRow[propertyInfo.Name] = propertyInfo.GetValue(objInstance, null); dtsModel.Tables[3].Rows.Add(dataRow); } var rptDeposit = new CsrDeposit(); rptDeposit.SetDataSource(dtsModel); crvReport.ReportSource = rptDeposit; }
public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { CsrDeposit rpt = new CsrDeposit(); rpt.Site = this.Site; return rpt; }