I have a need to be able to unwrap the contents of a ValueBasedAppearance in order to build strings etc that define how to show the same results in third party reporting package (dynamically).
What I am seeing so far is this is not a easy task. Can you provide any guidance on how this decoding would be accomplished?
The way I have it running currently is to allow the user to create their own ValueBasedAppearance via a propertygrid and dialogs. It is less desirable to have the user define this capability in the reporting package and translate that to a ValueBasedAppearance however I can do that.
Thanks for your guidance,
Nick
Hey Mike,
Thanks so much that is just the help I needed to get me started. Very seldom use the designer, providing the client a dynamic experience is more what is done.
This helps me add one more feature to bridge between the grid and the third party reporting component.
Thanks,
Hi Nick,
It's possible to get at this, but it's a little tricky to do since the ValueBasedAppearance was built for the designer only. Please try out the following code. I wasn't sure how to best store the data for the needs of your project, so I just went with two separate lists as a simple example. You may want to create a data structure to associate conditions to appearances in a way that works for your application's requirements.
private void FindConditions(UltraGrid grid, List conditionList, List appearanceList){ foreach (UltraGridColumn column in grid.DisplayLayout.Bands[0].Columns) { ConditionValueAppearance condition = column.ValueBasedAppearance as ConditionValueAppearance; if (condition != null) { IEnumerator enumerator = condition.Conditions; while (enumerator.MoveNext() == true) { OperatorCondition operatorCondition = enumerator.Current as OperatorCondition; conditionList.Add(operatorCondition); appearanceList.Add(condition[operatorCondition]); } } }}