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

            rpt.Site = this.Site;
            return(rpt);
        }
Esempio n. 2
0
        public void ShowCustShareLedgerReport()
        {
            _branchId       = GlobalVariableBO._branchId;
            _shareSummery   = rdoShareSummery.Checked;
            _Details        = rdoDetailShareLedger.Checked;
            _SpecificPeriod = rdoSpecificPeriodShareLedger.Checked;
            _fromDate       = Convert.ToDateTime(dtFromDate.Value.ToShortDateString());
            _toDate         = Convert.ToDateTime(dtToDate.Value.ToShortDateString());
            _custCode       = txtCustCode.Text;
            ShareLedgerBAL shareLedgerBal = new ShareLedgerBAL();

            _maxPriceDate = shareLedgerBal.GetMaxPriceDate();
            LoadCommonInfo CmmInfo = new LoadCommonInfo();

            if (_shareSummery)
            {
                ShowPortFolioReportInvestorWise();
            }
            else if (_Details)
            {
                crShareDetails     crShareDetail     = new crShareDetails();
                ShareDetailsViewer shareDetailViewer = new ShareDetailsViewer();
                DataTable          dtShareDetails    = new DataTable();
                string             Temp_Custcode     = "";

                RecordLevelFilteringBAL obj = new RecordLevelFilteringBAL(ResourceName.Customer_Share_Ledger_Share_Portfolio_Details_Specific_Period);
                Temp_Custcode = obj.FilterCustCode(_custCode, ResourceName.Customer_Share_Ledger_Share_Portfolio_Details_Specific_Period);

                dtShareDetails = shareLedgerBal.GetShareDetails(Temp_Custcode);


                crShareDetail.SetDataSource(dtShareDetails);
                ///// Load Company Name
                ((TextObject)crShareDetail.ReportDefinition.Sections[2].ReportObjects["txtCompanyName"]).Text = CmmInfo.ShowCompanyName();

                ///// Load Branch Name
                ((TextObject)crShareDetail.ReportDefinition.Sections[2].ReportObjects["txtBranchName"]).Text = CmmInfo.BranchDetails(_branchId);
                shareDetailViewer.crvShareDetailsReportViewer.ReportSource = crShareDetail;
                shareDetailViewer.Show();
            }

            else if (_SpecificPeriod)
            {
                //crSpecificShareLedger crSpecificShare = new crSpecificShareLedger();
                crShareDetails            crSpecificShare           = new crShareDetails();
                SpecificShareLedgerViewer specificShareLedgerViewer = new SpecificShareLedgerViewer();
                DataTable dtSpecificShareLedger = new DataTable();
                string    Temp_Custcode         = "";
                RecordLevelFilteringBAL obj     = new RecordLevelFilteringBAL(ResourceName.Customer_Share_Ledger_Share_Portfolio_Details_Specific_Period);
                Temp_Custcode         = obj.FilterCustCode(_custCode, ResourceName.Customer_Share_Ledger_Share_Portfolio_Details_Specific_Period);
                dtSpecificShareLedger = shareLedgerBal.GetSpecificShareLedger(Temp_Custcode, _fromDate, _toDate);

                crSpecificShare.SetDataSource(dtSpecificShareLedger);
                ///// Load Company Name
                ((TextObject)crSpecificShare.ReportDefinition.Sections[2].ReportObjects["txtCompanyName"]).Text = CmmInfo.ShowCompanyName();

                ///// Load Branch Name
                ((TextObject)crSpecificShare.ReportDefinition.Sections[2].ReportObjects["txtBranchName"]).Text = CmmInfo.BranchDetails(_branchId);
                ((TextObject)crSpecificShare.ReportDefinition.Sections[2].ReportObjects["txtduration"]).Text   = "Duration : " + dtFromDate.Value.ToString("dd-MMM-yyyy") + " To " + dtToDate.Value.ToString("dd-MMM-yyyy");
                specificShareLedgerViewer.crvSpecificShareLedgerReportViewer.ReportSource = crSpecificShare;
                specificShareLedgerViewer.Show();
            }
            else
            {
                MessageBox.Show("Please Select the report category first.");
            }
        }