在Microsoft Report Viewer中动态填充列标题

时间:2021-08-19 08:15:41

I am generating a report using microsoft report viewer, I have to display the data for each day of selected month from dropdown in report, In this case how to change the column header dynamically with Date of month. Bcz with predefined dataset which we used to publish report I am not able to do like this, as in this case column headers name remains fixed.

我正在使用微软报表查看器生成报表,我必须从报表中的下拉列表中显示所选月份的每一天的数据,在这种情况下,如何使用月份日期动态更改列标题。使用我们用于发布报告的预定义数据集的Bcz我不能这样做,因为在这种情况下列标题名称仍然是固定的。

For example, if user selected July then report should be like this-- Column Headers-- 07/01 07/02 07/03 07/04 .................07/31.

例如,如果用户选择7月,那么报告应该是这样的 - 列标题 - 07/01 07/02 07/03 07/04 ................. 07 / 31。

1 个解决方案

#1


0  

I assume that your dataset has a value with the date-of-month for each of your results.

我假设您的数据集的值包含每个结果的日期。

Create a single column group, showing the total in the details row, and have the header row show the date.

创建单个列组,在详细信息行中显示总计,并使标题行显示日期。

Below is a sample

以下是一个示例

with the following simple Dataset

使用以下简单的数据集

DateOfMonth    Total
2015/03/04      44
2015/03/05      55
2015/03/06      66
2015/03/07      77
2015/03/07      11

The following setup of Column groups

列组的以下设置

在Microsoft Report Viewer中动态填充列标题

Produces the following results 在Microsoft Report Viewer中动态填充列标题

产生以下结果

Then you just have to work out formatting, etc...

然后你只需要编制格式等...

#1


0  

I assume that your dataset has a value with the date-of-month for each of your results.

我假设您的数据集的值包含每个结果的日期。

Create a single column group, showing the total in the details row, and have the header row show the date.

创建单个列组,在详细信息行中显示总计,并使标题行显示日期。

Below is a sample

以下是一个示例

with the following simple Dataset

使用以下简单的数据集

DateOfMonth    Total
2015/03/04      44
2015/03/05      55
2015/03/06      66
2015/03/07      77
2015/03/07      11

The following setup of Column groups

列组的以下设置

在Microsoft Report Viewer中动态填充列标题

Produces the following results 在Microsoft Report Viewer中动态填充列标题

产生以下结果

Then you just have to work out formatting, etc...

然后你只需要编制格式等...