Пример #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            CrystalReportBL rpt = new CrystalReportBL();

            rpt.Site = this.Site;
            return(rpt);
        }
Пример #2
0
        private void CRP_BL_Load(object sender, EventArgs e)
        {
            try
            {
                SqlConnection  cn = new SqlConnection(@"Data Source =.\SQLEXPRESS ;Initial Catalog = gestcom; Integrated Security = True");
                DataSet1       ds = new DataSet1();
                SqlDataAdapter da = new SqlDataAdapter();

                da = new SqlDataAdapter("select * from DETAIL_BL", cn);
                da.Fill(ds, "DETAIL_BL");

                da = new SqlDataAdapter("select * from BL", cn);
                da.Fill(ds, "BL");

                CrystalReportBL crpBL = new CrystalReportBL();
                crystalReportViewer1.ReportSource = crpBL;
                crystalReportViewer1.Refresh();
                crpBL.SetDataSource(ds);//.Tables["nomtable"]
            }
            catch (Exception es)
            {
                MessageBox.Show(es.Message);
            }
        }