如何更改Report Viewer报告的列名?

时间:2022-12-23 08:23:54

I am using ASP.NET/C#.I am using Report Viewer control to display a basic report.Currently the data is shown properly however the column names are the same as when selected while configuring the Report Wizard.

我正在使用ASP.NET / C#。我使用报表查看器控件来显示基本报表。当前数据显示正确,但列名与配置报表向导时选择的列名相同。

Example:

例:

cFirstName is displayed as cFirstName in the column header of the Report Viewer.

cFirstName在报表查看器的列标题中显示为cFirstName。

I would want to change it to First Name instead.

我想把它改成名字而不是。

Here is the image of the issue.

这是问题的图像。

如何更改Report Viewer报告的列名?

Can anyone help me to achieve this?

任何人都可以帮我实现这个目标吗?

Any suggestions are welcome.

欢迎任何建议。

Thanks.

谢谢。

1 个解决方案

#1


1  

You can set this in the rdl, rdlc file.

您可以在rdl,rdlc文件中进行设置。

This is where it should normally be done.

这是通常应该完成的地方。

It cannot be done through c#, unless you take that column name as a report parameter and set the column header using that parameter.

它不能通过c#完成,除非您将该列名称作为报表参数并使用该参数设置列标题。

#1


1  

You can set this in the rdl, rdlc file.

您可以在rdl,rdlc文件中进行设置。

This is where it should normally be done.

这是通常应该完成的地方。

It cannot be done through c#, unless you take that column name as a report parameter and set the column header using that parameter.

它不能通过c#完成,除非您将该列名称作为报表参数并使用该参数设置列标题。