Loading

RDLC-Chart饼图上显示百分比

RDLC在饼图上显示百分比不像水晶报表那样便捷,需要自己定义相应的公式。但这种方式也使得RDLC更为灵活。

在RDLC的饼图上显赫百分比可参考如下公式:

=FormatPercent(Count(Fields!ProductId.Value)/Count(Fields!ProductId.Value, "ReportDataSet_OrderView"),2)

FormatPercent(XX,2)表示格式化为两位小数的百分比。

关键为Count(Fields!ProductId.Value)及Count(Fields!ProductId.Value, "ReportDataSet_OrderView")

Count(Fields!ProductId.Value)的域为遍历的当前域,从而可以取到当前分组的Count值;

Count(Fields!ProductId.Value, "ReportDataSet_OrderView")表示整个数据集,从而可以取到总数值。

posted @ 2011-05-17 19:17  Dhoopu  阅读(842)  评论(0编辑  收藏  举报