C# 将datatable绑定到rdlc报表

C# 将datatable绑定到rdlc报表,c#,rdlc,C#,Rdlc,我想将datatable绑定到rdlc报表 但mydatatable字段的名称包含特殊字母,例如。 avg(%) 我无法更改字段名 我无法在xsd.file xsd.file中的字段名与dataTable中的字段名不同 因此,我无法将datatable绑定到rdlc报表 以下是我的代码: LocalReport report = new LocalReport(); report.SetParameters(new ReportParameter("name"), name)); ... (

我想将
datatable
绑定到
rdlc
报表

  • 但my
    datatable
    字段的名称包含特殊字母,例如。
    avg(%)
  • 我无法更改字段名
  • 我无法在
    xsd.file
  • xsd.file
    中的字段名与
    dataTable
    中的字段名不同
因此,我无法将
datatable
绑定到
rdlc
报表

以下是我的代码:

LocalReport report = new LocalReport();
report.SetParameters(new ReportParameter("name"), name));
... (???)
report.DataSources.Add(new ReportDataSource("Student", dt as DataTable));

请帮帮我。

XSD文件不允许使用前面提到的
name
属性中的特殊字符。我相信重命名数据库中的字段并删除特殊字符是唯一的途径;rdlc是html,这将转换特殊字符。不幸的是,我无法删除特殊字符…cs文件中有解决方案吗???就像绑定字段名一样…我没有说删除。该代码用于转换特殊字符。请参见wiki:,该实用程序将执行转换