public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { cr_MonthlyExpenseReport rpt = new cr_MonthlyExpenseReport(); rpt.Site = this.Site; return(rpt); }
private void ShowMonthlyExpenseReport(DateTime FromDate, DateTime ToDate) { try { AssetInformationBAL objAssetInfoBal = new AssetInformationBAL(); DataTable dtMonthlyExpenseInfo = new DataTable(); cr_MonthlyExpenseReport objcrMonthlyExpenseInfo = new cr_MonthlyExpenseReport(); frmReportViewer objfrmMonthlyExpenseInfo = new frmReportViewer(); RecordLevelFilteringBAL recordLevelFilteringBAL = new RecordLevelFilteringBAL(); int TempBranchId = -2; dtMonthlyExpenseInfo = objAssetInfoBal.GetMonthlyCapexReport(FromDate, ToDate); int branchid = Int32.Parse(dtMonthlyExpenseInfo.Rows[0][10].ToString()); int resourceId = recordLevelFilteringBAL.GetResourceID(ResourceName.Monthly_Expense_List); int criteriaId = recordLevelFilteringBAL.GetCriteriaID(resourceId); TempBranchId = Convert.ToInt32(recordLevelFilteringBAL.FilterBranchID(branchid.ToString(), resourceId, criteriaId)); if (TempBranchId == -1) { dtMonthlyExpenseInfo.Rows.Clear(); } objcrMonthlyExpenseInfo.SetDataSource(dtMonthlyExpenseInfo); ((TextObject)objcrMonthlyExpenseInfo.ReportDefinition.Sections[2].ReportObjects["txtFromDate"]).Text = "Fom: " + dtpFromDate.Value.ToString("MM-dd-yyyy"); ((TextObject)objcrMonthlyExpenseInfo.ReportDefinition.Sections[2].ReportObjects["txtToDate"]).Text = "To: " + dtpToDate.Value.ToString("MM-dd-yyyy"); GetCommonInfo(); ((TextObject)objcrMonthlyExpenseInfo.ReportDefinition.Sections[2].ReportObjects["txtCompanyName"]).Text = _CommpanyName; ((TextObject)objcrMonthlyExpenseInfo.ReportDefinition.Sections[2].ReportObjects["txtAddress"]).Text = "Branch Name:" + _branchName + "," + _branchAddress + ". Phone:" + _branchContactNumber; objfrmMonthlyExpenseInfo.Text = "Monthly Expense Report"; objfrmMonthlyExpenseInfo.crvReportViewer.ReportSource = objcrMonthlyExpenseInfo; objfrmMonthlyExpenseInfo.Show(); } catch (Exception) { throw; } }