public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { CrTotalExpense rpt = new CrTotalExpense(); rpt.Site = this.Site; return(rpt); }
private void GetTotalExpenseList() { try { AssetInformationBAL objAssetInformationBal = new AssetInformationBAL(); DataTable dtTotalExpenseLise = new DataTable(); frmReportViewer objfrmReportViewer = new frmReportViewer(); CrTotalExpense objcrTotalAssetList = new CrTotalExpense(); RecordLevelFilteringBAL recordLevelFilteringBAL = new RecordLevelFilteringBAL(); int TempBranchId = -2; dtTotalExpenseLise = objAssetInformationBal.GetTotalAssetExpense(); int branchid = Int32.Parse(dtTotalExpenseLise.Rows[0][11].ToString()); int resourceId = recordLevelFilteringBAL.GetResourceID(ResourceName.Total_Expense_List); int criteriaId = recordLevelFilteringBAL.GetCriteriaID(resourceId); TempBranchId = Convert.ToInt32(recordLevelFilteringBAL.FilterBranchID(branchid.ToString(), resourceId, criteriaId)); if (TempBranchId == -1) { dtTotalExpenseLise.Rows.Clear(); } objcrTotalAssetList.SetDataSource(dtTotalExpenseLise); objfrmReportViewer.crvReportViewer.DisplayGroupTree = false; objfrmReportViewer.crvReportViewer.ReportSource = objcrTotalAssetList; GetCommonInfo(); ((TextObject)objcrTotalAssetList.ReportDefinition.Sections[2].ReportObjects["txtCompanyName"]).Text = _CommpanyName; ((TextObject)objcrTotalAssetList.ReportDefinition.Sections[2].ReportObjects["txtAddress"]).Text = "Branch Name:" + _branchName + "," + _branchAddress + ". Phone:" + _branchContactNumber; objfrmReportViewer.Text = "Total Expense List"; objfrmReportViewer.Show(); } catch (Exception) { throw; } }