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

            rpt.Site = this.Site;
            return(rpt);
        }
コード例 #2
0
        private void genReportSt_Click(object sender, EventArgs e)
        {
            DataSet2St ds  = new DataSet2St();
            SqlCommand cmd = con.CreateCommand();

            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "select * from student_info ";
            cmd.ExecuteNonQuery();
            DataTable      dt = new DataTable();
            SqlDataAdapter da = new SqlDataAdapter(cmd);

            da.Fill(ds.DataTable2);
            CrystalReportStudent myreport = new CrystalReportStudent();

            myreport.SetDataSource(ds);
            crystalReportViewerSt.ReportSource = myreport;
        }