public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            cr_DSE_22_1 rpt = new cr_DSE_22_1();

            rpt.Site = this.Site;
            return(rpt);
        }
Beispiel #2
0
        private void ShowPortFolioReportInvestorWise()
        {
            cr_DSE_22_1            objcr_DSE_22_1Report           = new cr_DSE_22_1();
            DataTable              dtProtofolioReportInvestorwise = new DataTable();
            DESReportBal           objPortfolioBal        = new DESReportBal();
            CustShareSummeryViewer objfrm_DSE_22_1_Report = new CustShareSummeryViewer();
            string deposit          = "0.00";
            string withdraw         = "0.00";
            string balance          = "0.00";
            string accruedbalance   = "0.00";
            string IPObalance       = "0.00";
            string availablebalance = "0.00";
            string netbalance       = "0.00";



            try
            {
                ShareLedgerBAL shareLedgerBal     = new ShareLedgerBAL();
                DataTable      dtCustSummerybasic = new DataTable();

                RecordLevelFilteringBAL obj = new RecordLevelFilteringBAL(ResourceName.Customer_Share_Ledger_Share_Portfolio_Summery);
                string T_Custcode           = obj.FilterCustCode(_custCode, ResourceName.Customer_Share_Ledger_Share_Portfolio_Summery);
                if (T_Custcode == "")
                {
                    MessageBox.Show("You are restricted");
                    return;
                }
                dtCustSummerybasic = shareLedgerBal.GetCustomerSummerBasicInfo(T_Custcode, dtToDate.Value);

                if (dtCustSummerybasic.Rows.Count != 0)
                {
                    deposit          = Convert.ToDouble(dtCustSummerybasic.Rows[0]["Dep_Amount"]).ToString("N");
                    withdraw         = Convert.ToDouble(dtCustSummerybasic.Rows[0]["Withdraw_Amount"]).ToString("N");
                    balance          = Convert.ToDouble(dtCustSummerybasic.Rows[0]["Head_Balance"]).ToString("N");
                    accruedbalance   = Convert.ToDouble(dtCustSummerybasic.Rows[0]["Accrued_Balance"]).ToString("N");
                    IPObalance       = Convert.ToDouble(dtCustSummerybasic.Rows[0]["IPO_Balance"]).ToString("N");
                    availablebalance = (Convert.ToDecimal(balance) - (Convert.ToDecimal(accruedbalance))).ToString("N");
                    netbalance       = (Convert.ToDecimal(availablebalance) + Convert.ToDecimal(IPObalance)).ToString("N");
                }

                string temp_custCode = obj.FilterCustCode(_custCode, ResourceName.Customer_Share_Ledger_Share_Portfolio_Summery);
                dtProtofolioReportInvestorwise = objPortfolioBal.Get_DSE_22_1_Report(temp_custCode, dtToDate.Value);

                objcr_DSE_22_1Report.SetDataSource(dtProtofolioReportInvestorwise);

                GetCommonInfo();
                ((TextObject)objcr_DSE_22_1Report.ReportDefinition.Sections[2].ReportObjects["txtCompanyName"]).Text =
                    _CommpanyName;
                ((TextObject)objcr_DSE_22_1Report.ReportDefinition.Sections[2].ReportObjects["txtBranchInfo"]).Text =
                    _branchAddress + ". Phone:" + _branchContactNumber;

                ((TextObject)objcr_DSE_22_1Report.ReportDefinition.Sections[2].ReportObjects["txtCustCode"]).Text =
                    txtCustCode.Text;
                ((TextObject)objcr_DSE_22_1Report.ReportDefinition.Sections[2].ReportObjects["txtBOID"]).Text =
                    txtAccountHolderBOId.Text;
                ((TextObject)objcr_DSE_22_1Report.ReportDefinition.Sections[2].ReportObjects["txtCustName"]).Text =
                    txtAccountHolderName.Text;

                ((TextObject)objcr_DSE_22_1Report.ReportDefinition.Sections[2].ReportObjects["txtDeposit"]).Text =
                    deposit;
                ((TextObject)objcr_DSE_22_1Report.ReportDefinition.Sections[2].ReportObjects["txtWithdraw"]).Text =
                    withdraw;
                //((TextObject)objcr_DSE_22_1Report.ReportDefinition.Sections[2].ReportObjects["txtBalance"]).Text =
                //   balance;
                ((TextObject)objcr_DSE_22_1Report.ReportDefinition.Sections[2].ReportObjects["txtCurrentTradeBalance"]).Text =
                    balance;
                ((TextObject)objcr_DSE_22_1Report.ReportDefinition.Sections[2].ReportObjects["txtTotalAcrudeCharge"]).Text =
                    accruedbalance;
                ((TextObject)objcr_DSE_22_1Report.ReportDefinition.Sections[2].ReportObjects["txtAvailableBalance"]).Text =
                    availablebalance;
                ((TextObject)objcr_DSE_22_1Report.ReportDefinition.Sections[2].ReportObjects["txtIPOBalance"]).Text =
                    IPObalance;
                ((TextObject)objcr_DSE_22_1Report.ReportDefinition.Sections[2].ReportObjects["txtNetBalance"]).Text =
                    netbalance;



                ((TextObject)objcr_DSE_22_1Report.ReportDefinition.Sections[2].ReportObjects["asOnDate"]).Text =
                    dtToDate.Value.ToString("dd/MMM/yyyy");

                objfrm_DSE_22_1_Report.crvShareSummeryReportViewer.ReportSource     = objcr_DSE_22_1Report;
                objfrm_DSE_22_1_Report.crvShareSummeryReportViewer.DisplayGroupTree = false;
                objfrm_DSE_22_1_Report.Show();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Portfolio Report Investor Wise", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }