コード例 #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            crCustomerSummery rpt = new crCustomerSummery();

            rpt.Site = this.Site;
            return(rpt);
        }
コード例 #2
0
        public void ShowCustSummeryReport()
        {
            _branchId = GlobalVariableBO._branchId;
            _fromDate = Convert.ToDateTime(dtFromDate.Value.ToShortDateString());
            _toDate   = Convert.ToDateTime(dtToDate.Value.ToShortDateString());
            _custCode = txtCustCode.Text;

            CustomerSummeryBAL    customerSummeryBal = new CustomerSummeryBAL();
            crCustomerSummery     crCustomerSumm     = new crCustomerSummery();
            CustomerSummeryViewer custSumViewer      = new CustomerSummeryViewer();
            DataTable             dtCustSummery      = new DataTable();

            RecordLevelFilteringBAL obj = new RecordLevelFilteringBAL(ResourceName.Customer_Summery_Ledger);
            string T_custCode           = obj.FilterCustCode(_custCode, ResourceName.Customer_Summery_Ledger);

            dtCustSummery = customerSummeryBal.GetCustSummery(T_custCode, _fromDate, _toDate);
            crCustomerSumm.SetDataSource(dtCustSummery);

            ////Load Summery Data
            DataTable dtSummeryTrans   = new DataTable();
            DataTable dtPaymentSummery = new DataTable();

            string summerycustCode = obj.FilterCustCode(_custCode, ResourceName.Customer_Summery_Ledger);

            dtSummeryTrans = customerSummeryBal.GetSummeryDataTransaction(summerycustCode, _fromDate, _toDate);

            string paymentcustCode = obj.FilterCustCode(_custCode, ResourceName.Customer_Summery_Ledger);

            dtPaymentSummery = customerSummeryBal.GetSummeryDataPayment(paymentcustCode, _fromDate, _toDate);

            if (dtSummeryTrans.Rows.Count > 0)
            {
                ((TextObject)crCustomerSumm.ReportDefinition.Sections[4].ReportObjects["txtBuyAmount"]).Text  = String.Format("{0:0.##}", dtSummeryTrans.Rows[0]["TotalBuyAmount"]);
                ((TextObject)crCustomerSumm.ReportDefinition.Sections[4].ReportObjects["txtSellAmount"]).Text = String.Format("{0:0.##}", dtSummeryTrans.Rows[0]["TotalSellAmount"]);
                ((TextObject)crCustomerSumm.ReportDefinition.Sections[4].ReportObjects["txtCommission"]).Text = String.Format("{0:0.##}", dtSummeryTrans.Rows[0]["TotalCommission"]);
            }
            if (dtPaymentSummery.Rows.Count > 0)
            {
                ((TextObject)crCustomerSumm.ReportDefinition.Sections[4].ReportObjects["txtReceived"]).Text = String.Format("{0:0.##}", dtPaymentSummery.Rows[0]["TotalDeposit"]);
                ((TextObject)crCustomerSumm.ReportDefinition.Sections[4].ReportObjects["txtWithdraw"]).Text = String.Format("{0:0.##}", dtPaymentSummery.Rows[0]["TotalWithdraw"]);
            }

            GetCommonInfo();
            ///// Load Company Name
            ((TextObject)crCustomerSumm.ReportDefinition.Sections[2].ReportObjects["txtCompanyName"]).Text = _CommpanyName;
            ///// Load Branch Name
            ((TextObject)crCustomerSumm.ReportDefinition.Sections[2].ReportObjects["txtBranchName"]).Text = "Branch Name:" + _branchName + "," + _branchAddress + ". Phone:" + _branchContactNumber;
            ////Load Date
            if (_fromDate != null && _toDate != null)
            {
                ((TextObject)crCustomerSumm.ReportDefinition.Sections[2].ReportObjects["txtReportDuration"]).Text = "Duration : " + _fromDate.ToString("dd-MMM-yyyy") + " To " + _toDate.ToString("dd-MMM-yyyy");
            }
            custSumViewer.crvCustSummeryReportViewer.ReportSource     = crCustomerSumm;
            custSumViewer.crvCustSummeryReportViewer.DisplayGroupTree = false;
            custSumViewer.Show();
        }