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

            rpt.Site = this.Site;
            return(rpt);
        }
コード例 #2
0
        private void crystalReportViewer1_Load(object sender, EventArgs e)
        {
            DsImp Ds    = new DsImp();
            int   filas = dt.Rows.Count;

            for (int i = filas - 1; i > -1; i--)
            {
                DataRow dr = dt.Rows[i];
                Ds.Tables[0].Rows.Add
                    (dr[2].ToString(), dr[3].ToString(), dr[5].ToString(), dr[6].ToString(), dr[7].ToString(), dr[10].ToString(), dr[16].ToString(), dr[1].ToString());
            }
            //Hago visible el report viewer
            crystalReportViewer1.Visible = true;

            //Instancio el ReportImpre creado
            ReportImpre RImp = new ReportImpre();

            //Cargo el reportImpre con el dataset Ds
            RImp.SetDataSource(Ds);

            //Cargo el report viewer con el ReportImp
            crystalReportViewer1.ReportSource = RImp;
        }