예제 #1
0
        private void btnParentChild_Click(object sender, EventArgs e)
        {
            rptParent doc = new rptParent();

            DataSet ds = new DataSet();

            ds.Tables.Add(DBMaker.班级表());
            ds.Tables.Add(DBMaker.学生表());

            ds.Tables[0].TableName = "班级";
            ds.Tables[1].TableName = "学生";



            doc.SetDataSource(ds);
            crystalReportViewer1.ReportSource = doc;
        }
예제 #2
0
        private void btnParentChild_Click(object sender, EventArgs e)
        {
            reportViewer1.Reset();

            reportViewer1.LocalReport.ReportEmbeddedResource = "AboutReport.RDLC.rptParent.rdlc";
            reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetStudent_班级", DBMaker.班级表()));
            reportViewer1.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(LocalReport_SubreportProcessing);
            this.reportViewer1.RefreshReport();
        }