문제

I have built a gantt chart in MS report builder 3 which reports on a teams currently assigned projects and the expected time of completion. I am trying to fill the series color with the same color where a project name exists more than once, i.e 2 teams can be assigned the same project thus the charts bar should display the same color every time the same project name occurs.

I have tried creating a dataset which returns distinct project names and then create a function on the series fill that switches between each value but I have had no success, as below:

=Switch(Fields!ProjectName.Value IS First(Fields!ProjectName.Value, "ActiveProjects"), "#00000000")

It is also worth noting that these project names will be replaced and updated over time thus the color can't be static and needs to be automatic upon generation of the report.

Can anyone provide a solution for this scenario?

도움이 되었습니까?

해결책

In case anyone else comes across a similar problem I resolved my issue by adding my own column to my original data set.

This value uses the below syntax:

HEX = '#' + RIGHT(LEFT(master.dbo.fn_varbintohexstr(CAST(p.ProjectName AS VARBINARY(10))), 9), 6)

I'm basically using the built in varbinary to hex string function to evaluate a hex value every time a distinct project name exists.

Back to report builder, I simply change the series fill color option to the value of this column.

Hope this helps someone.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top