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

            rpt.Site = this.Site;
            return(rpt);
        }
Esempio n. 2
0
        private void btnNewPortfolioReport_Click(object sender, EventArgs e)
        {
            //if (ValidationCheck())
            //    return;

            ShareDWBAL            shareDwbal           = new ShareDWBAL();
            ShareLedgerBAL        bal                  = new ShareLedgerBAL();
            MoneyLadgerReportBAL  moneyLedgerReportBal = new MoneyLadgerReportBAL();
            DataTable             dtPort               = new DataTable();
            frmReportViewer       viewer               = new frmReportViewer();
            cr_NewPortfolioWithGL rpt                  = new cr_NewPortfolioWithGL();

            DataTable dtCommission   = shareDwbal.GetCommissionRate(txtCustCode.Text.Trim());
            double    CommissionRate = Convert.ToDouble(dtCommission.Rows[0][0].ToString());

            //string AsOnDateeeeee=Convert.ToString
            dtPort = bal.PortfolioWithActualBEPRealizeGL(txtCustCode.Text.Trim(), CommissionRate, dtToDate.Value);

            DataTable dtCustBasicInfo = moneyLedgerReportBal.GetCustBasicInfo(txtCustCode.Text.Trim());

            ((TextObject)rpt.ReportDefinition.Sections[1].ReportObjects["txtCustCode"]).Text =
                "Cust. Code: " + dtCustBasicInfo.Rows[0]["Cust_Code"].ToString();
            ((TextObject)rpt.ReportDefinition.Sections[1].ReportObjects["txtBOID"]).Text =
                "Cust. BO ID: " + dtCustBasicInfo.Rows[0]["BO_ID"].ToString();
            ((TextObject)rpt.ReportDefinition.Sections[1].ReportObjects["txtCustName"]).Text =
                "Cust. Name: " + dtCustBasicInfo.Rows[0]["Cust_Name"].ToString();
            ((TextObject)rpt.ReportDefinition.Sections[1].ReportObjects["AsOnDate"]).Text =
                "As On: " + dtToDate.Value.ToString("dd MMMM yyyy") + "";
            GetCommonInfo();
            ((TextObject)rpt.ReportDefinition.Sections[1].ReportObjects["txtCompanyName"]).Text = _CommpanyName;
            ((TextObject)rpt.ReportDefinition.Sections[1].ReportObjects["txtBranchName"]).Text  =
                _branchName + ", " + _branchAddress + ", " + "Phone: " + _branchContactNumber;
            ((TextObject)rpt.ReportDefinition.Sections[1].ReportObjects["txtReportName"]).Text = "Portfolio Statement";
            rpt.SetDataSource(dtPort);
            viewer.crvReportViewer.ReportSource = rpt;
            viewer.Show();
        }