How to generate an RDLC file using C# during runtime

后端 未结 5 1116
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-07 07:38

I\'m doing some application development (CRM solution) which require generating diagrammatically an RDLC file at runtime. How do I do that?

5条回答
  •  独厮守ぢ
    2021-02-07 07:38

    ALL you have to do is change the the data source by coding. like

            ReportViewer.LocalReport.DataSources.Clear();
            ReportViewer.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local;
    
    
            ReportDataSource RDS = new ReportDataSource();
            RDS.Name = "DataSet";
    
    
            RDS.Value = itemReportTableBindingSource;
            ReportViewer.LocalReport.ReportEmbeddedResource = "RFID.Reports.ItemsReport.rdlc";
            ReportViewer.LocalReport.DataSources.Add(RDS);
    
            this.itemReportTableTableAdapter.Fill(this.reportsDataSet.ItemReportTable);
            this.ReportViewer.RefreshReport();
    

提交回复
热议问题