c#报表原生报表子报表

public frmCawbReport(ScanCawb sc, double pageWidth, double pageHeight)
        {
            InitializeComponent();
            var report = new LocalReport
            {
                EnableExternalImages = true,
                ReportEmbeddedResource = "Managistics.PrintClient.RDLC.ScanSheet.CawbReport.rdlc"
            };
            report.DataSources.Add(new ReportDataSource("DataSet1", sc.printSheet));
            report.SubreportProcessing += delegate (object sender, SubreportProcessingEventArgs e)
            {
                e.DataSources.Add(new ReportDataSource("DataSet1", sc.printElectronic));//子报表数据源
            };
            PageWidth = pageWidth / 100;
            PageHeight = pageHeight / 100;
            LocalReport = report;
        }

指定子报表名称

 

posted @ 2020-11-17 16:11  世人皆萌  阅读(514)  评论(1编辑  收藏  举报