代码之家  ›  专栏  ›  技术社区  ›  Pranay Rana

如何在运行时使用c生成RDLC文件

  •  17
  • Pranay Rana  · 技术社区  · 15 年前

    我正在做一些应用程序开发(CRM解决方案),需要 以图表方式生成 RDLC 运行时的文件。我该怎么做?

    5 回复  |  直到 9 年前
        1
  •  15
  •   Giorgi    15 年前

    您可以使用“动态生成RDLC-表”示例 got reportviewer?

        2
  •  2
  •   Peter Mortensen icecrime    14 年前

    感谢所有回答此问题的人的回答,但我找到了一篇很好的文章来生成动态报告: Dynamic Reports with Reporting Services .

        3
  •  1
  •   StuartLC    15 年前

    我可以确认您正在尝试基于RDLC构建一个动态报告解决方案,还是只需要挖掘存储在CRM中的数据并将其显示在RDLC中。我想你已经用尽了其他工具,比如ProClarity和Excel,让用户来挖掘数据。

    假设前者(即RDLC设计器),那么RDLC只是一个XML文件,所以我想您可以在从设计器中导出某种XML“模型”之后,通过应用XSLT来创建包含数据源、字段定义、单元格等的简单、标准的RDLC?

    听起来工作量很大;)

        4
  •  1
  •   jned29    9 年前

    您所要做的就是通过编码更改数据源。 喜欢

            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();
    
        5
  •  0
  •   dnxit    11 年前

    你应该查阅这个链接,也许会有所帮助

    How to dynamically add new columns to report created with Reporting Services?

    RDLC报告是一个XML文件,通过在XML文档中编辑它,您可以修改locate/report/body/reportitems/table节点,并在其中执行以下操作

    • 定义新列的标题“在标题节点内添加新的TableCell”
    • 用数据绑定列(从datatable)在细节节点中添加新的tablecell
    • 定义列的宽度“在TableColumns中添加新的TableColumn”
    推荐文章