Hi Guys,
We are loading the PivotDataSelector datasource via Linq To SQL, no issues here. The problem we have is that we would like to display a column name with spaces so that is looks better for reporting purposes ie 'ThisIsSomeValue' with 'This Is Some Value'
Below is the code I've taken from the WPF samples app:
private void GetData() { Type objectType = Type.GetType("POCServices.Data." + reportTypeComboEditor.Value.ToString() + ", POCServices"); IEnumerable newInstance = (IEnumerable)Activator.CreateInstance(objectType); // This will create an instance of Opportunity class
GetData(newInstance); }
private void GetData<T>(T sourceObject) where T : IEnumerable { FlatDataSource dataSource = new FlatDataSource(); dataSource.ItemsSource = sourceObject;
POCServices.Interface.IView currentSource = (POCServices.Interface.IView)sourceObject; currentSource.GetHierarchies(dataSource);
this.pivotGrid.DataSource = dataSource; this.pivotDataSelector.DataSource = dataSource; }
public class Opportunity : ObservableCollection<zzOpportunities> {
public Opportunity() { List<zzOpportunities> opportunities = GetAll(); foreach (zzOpportunities opp in opportunities) { this.Add(opp); } }
public static List<zzOpportunities> GetAll() { EMDBDataContext dc = new EMDBDataContext(); return dc.GetTable<zzOpportunities>().ToList<zzOpportunities>(); }
}
As I mentioned earlier the above code works well, but how would I go about customizing what is shown in the PivotDataSelector after the control is bound to my datasource?Any help would be very much appreciated.
Cheers,
Marty.
Hello Marty,
Thank you for your post. I have been looking into your question and after loading the data you are not able to change the captions of the measured. I can suggest you change the dimension settings of the cube at the moment you define the measures as it is shown in the forum thread below :
http://es.infragistics.com/community/forums/p/64880/329568.aspx
If you have any other questions on this matter, feel free to ask.
Yanko,
Thanks a lot for your reply, the information provided was spot on.
I also found this link which was quite useful: http://help.infragistics.com/Help/NetAdvantage/WPFDV/2011.1/CLR4.0/html/xamPivotGrid_US_Defining_Hierarchies_And_Providing_Metadata_With_FlatData.html
Many thanks,
Hi Marty,
Thank you for your feedback. I am glad that you have managed to solve your issue.