public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { crIPOCustomerSummery rpt = new crIPOCustomerSummery(); rpt.Site = this.Site; return(rpt); }
public void ShowCustMoneyLedgerReport() { _branchId = GlobalVariableBO._branchId; _fromDate = Convert.ToDateTime(dtFromDate.Value.ToShortDateString()); _toDate = Convert.ToDateTime(dtToDate.Value.ToShortDateString()); _custCode = txtCustCode.Text; IPOCustomerSummeryLedgerBAL moneyLedgerReportBal = new IPOCustomerSummeryLedgerBAL(); DataTable dtCustmoneyLedger = new DataTable(); DataTable dtCustBasicInfo = new DataTable(); DataTable dtopenClose = new DataTable(); LoadCommonInfo CmmInfo = new LoadCommonInfo(); crIPOCustomerSummery crCustMoneyledger = new crIPOCustomerSummery(); frmIPOReportViewer viewer = new frmIPOReportViewer(); dtCustmoneyLedger = moneyLedgerReportBal.GetIPOCustSummeryLedger(_custCode, _fromDate, _toDate); dtCustBasicInfo = moneyLedgerReportBal.GetIpoCustSummaryBasicInfo(_custCode); dtopenClose = moneyLedgerReportBal.IpoOpenCloseWithdrawDepost(_custCode, _fromDate, _toDate); crCustMoneyledger.SetDataSource(dtCustmoneyLedger); if (dtopenClose.Rows.Count > 0) { ((TextObject)crCustMoneyledger.ReportDefinition.Sections[2].ReportObjects["txtopeningBalance"]).Text = String.Format("{0:0.##}", dtopenClose.Rows[0]["Open_Balance"]); //((TextObject)crCustMoneyledger.ReportDefinition.Sections[4].ReportObjects["txtCloseBalance"]).Text = String.Format("{0:0.##}", dtopenClose.Rows[0]["Close_Balance"]); ((TextObject)crCustMoneyledger.ReportDefinition.Sections[4].ReportObjects["txtDepost"]).Text = String.Format("{0:0.##}", dtopenClose.Rows[0]["total_Deposit"]); ((TextObject)crCustMoneyledger.ReportDefinition.Sections[4].ReportObjects["txtWithdraw"]).Text = String.Format("{0:0.##}", dtopenClose.Rows[0]["Toatal_Withdraw"]); } if (dtCustBasicInfo.Rows.Count > 0) { ((TextObject)crCustMoneyledger.ReportDefinition.Sections[2].ReportObjects["txtCustName"]).Text = dtCustBasicInfo.Rows[0]["Cust_Name"].ToString(); ((TextObject)crCustMoneyledger.ReportDefinition.Sections[2].ReportObjects["txtCustCode"]).Text = dtCustBasicInfo.Rows[0]["Cust_Code"].ToString(); ((TextObject)crCustMoneyledger.ReportDefinition.Sections[2].ReportObjects["txtboid"]).Text = dtCustBasicInfo.Rows[0]["BO_ID"].ToString(); ((TextObject)crCustMoneyledger.ReportDefinition.Sections[2].ReportObjects["txtduration"]).Text = "Duration : " + dtFromDate.Value.ToString("dd-MMM-yyyy") + " To " + dtToDate.Value.ToString("dd-MMM-yyyy"); //((TextObject)crCustMoneyledger.ReportDefinition.Sections[2].ReportObjects["txtreportName"]).Text = // "IPO Customer Money Ledger"; } GetCommonInfo(); ((TextObject)crCustMoneyledger.ReportDefinition.Sections[2].ReportObjects["txtCompanyName"]).Text = _CommpanyName; ///// Load Branch Name ((TextObject)crCustMoneyledger.ReportDefinition.Sections[2].ReportObjects["txtBranchName"]).Text = "Branch Name:" + _branchName + "," + _branchAddress + ". Phone:" + _branchContactNumber; viewer.crystalReportViewer1.ReportSource = crCustMoneyledger; viewer.Show(); }