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

            rpt.Site = this.Site;
            return(rpt);
        }
示例#2
0
        private void ReportView()
        {
            if (ddlCompanyShortCode.Text == string.Empty)
            {
                MessageBox.Show("Please Select Instrument Short Code");
                return;
            }
            DataTable       dt            = new DataTable();
            ShareBalanceBAL reportBAL     = new ShareBalanceBAL();
            LoadCommonInfo  CmmInfo       = new LoadCommonInfo();
            CompanyBAL      objCompanyBal = new CompanyBAL();

            string   compShortCode = ddlCompanyShortCode.Text;
            DateTime fromDate      = dtStartDate.Value;
            DateTime toDate        = dtEndDate.Value;

            dt = reportBAL.GetCompanyWiseShareTradeList(compShortCode, fromDate, toDate);

            crInstruwiseShareTradeList reportFile = new crInstruwiseShareTradeList();

            reportFile.SetDataSource(dt);

            ((TextObject)reportFile.ReportDefinition.Sections[1].ReportObjects["txtCompanyName"]).Text = CmmInfo.ShowCompanyName();
            ((TextObject)reportFile.ReportDefinition.Sections[1].ReportObjects["txtBranchName"]).Text  = objCompanyBal.GetHeadofficeInfo();
            ((TextObject)reportFile.ReportDefinition.Sections[1].ReportObjects["txtReportDate"]).Text  = "From " + fromDate.ToShortDateString() + " To " + toDate.ToShortDateString();


            ((TextObject)reportFile.ReportDefinition.Sections[1].ReportObjects["txtInstruName"]).Text  = Convert.ToString(dt.Rows[0][2]);
            ((TextObject)reportFile.ReportDefinition.Sections[1].ReportObjects["txtInstruCode"]).Text  = Convert.ToString(dt.Rows[0][1]);
            ((TextObject)reportFile.ReportDefinition.Sections[1].ReportObjects["txtInstruGroup"]).Text = Convert.ToString(dt.Rows[0][3]);

            frmInstruwiseShareTradeListViewer reportViewer = new frmInstruwiseShareTradeListViewer();

            reportViewer.crvInstruWiseShareTradeList.ReportSource = reportFile;
            reportViewer.Show();
        }