I need another syntax for expressing RDLC "= Fields! Xxx.Value", where xxx contains a period (.)

I generate a report dynamically.

I have two tables User and Branch, and both have a column name of "NAME". Therefore, I use "User.Name" and "Branch.Name" as the ColumnName in the DataTable and bind it to the RDLC using the following code:

foreach(DataColumn dc in dtUser.Columns)
{
     rpt.ADDField("=Fields!"+dc.ColumnName"+".Value");
}  

this results in the error: "The object name must be CLS-complient identifiers." I think this is because columnName contains a period (.).

Do we have any other syntax for this solution? (e.g. = Fields! [xxx.yyy] .Value)

+3
source share

All Articles