I created a custom color palette for my charts using a technique described on TechNet.
I also have a series of drill-through column charts, where you click on one column and it passes a parameter through to the next chart and so on, giving the appearance of drill-down.
My graphs consist of 3 types of labor, and have three colors on the main chart. When I drill down to the next chart, some of the categories do not have all three types of labor that the main one has. So the first color in the palette is assigned to the series, even though it was the second color on the previous chart. I’d like to avoid this, if possible.
So a data value is green on the first chart (2nd in the color order) and yellow on the next chart (1st in the color order). How do I make the graphs “remember” the total number of series groups that were in the first chart?
This is Reporting Services 2005.
I was able to solve this because I was using a custom color palette, implemented as a hash table. I basically serialized this information and passed it to a hidden parameter on the subreport and then reinflated the data structure.
It’s not perfect, but it works for now.
I ran into an issue where I couldn’t find the equivalent of the onLoad event for the report. Since I wasn’t sure where to put this inflate code, I stuck it in the background color of the plot area. Hence I always return “WhiteSmoke”. I’ll change this if I can find the right place to put it.
ToJaggedArray()andToHashTable()are helper functions because a HashTable is not serializable since they implement anIDictionary. I was in a hurry so I just converted them to an array right quick. Code comes from the Collection Serialization in ASP.NET WebServices article written by Mark Richman. I converted the code from C# to VB.NET to use in the report.
Now in the report itself you need to do a couple things.
System.Xmlin Report Properties in both reports.=Code.PassColorMapping()=Code.InflateParamMapping(Parameters!colorMapping)=Code.GetColor(Fields!Type.Value)You can continue doing this for as many subreports as you want – I currently have 3 levels of drill-through and it works fine.