Hello,
Yesterday I was demoing a new XAF application to my customer and decided to show them how powerful was the Analysis module.
- Here, you can create just about any statistic that you ever may need !
- Wow !!! Really ?
- Yes, just ask me anything and I will create it right now.
- I'm impressed. Show me the sales evolution over the last year.
- No problem (here I create an analysis for the order class, drop 2 fields on the pivoit and Boom, the analysis is there). And look, you even got a nice chart.
- Amazing. I dreamed about such a tool for years !
Ok, is it possible to see the evolution month by month, there is just too many values here ?
- Of course, you just group the date field (here I must admit I didn't played a lot with the module before, but I know how to use the PivotControl in WinForms). You can group by year, month, week, …
mmmhhhh, wait I don't know how to do this, I'll have to check the doc.
- No problem, this looks very promising. Can we try something else, the number of sales by vendor, oh no this one I already know. I want to have the average sales by day.
- Easy … just define an average column …
I'll stop here, you got my point.
I would just remind you that the icon you choosed to represent the pivot grid in you winforms component is a sum symbol (http://documentation.devexpress.com/#WindowsForms/CustomDocument3409)
All the power of the pivot comes from its ability to easily display summaries, group, and things like that.
I know this won't be there in 10.2 but please, do something for 11.1. This module is just not "XAF minded", the developper has to do everything.
This module is now just a grid where you can select columns positions.
I've read a post of one of your latest eveangelist saying that the DevExpress product line line is all about representing data. XAF, is your most powerfull tool but its pivot module is just useless …
To finish :
1/ for me the B32274 bug is not fixed as it was marked. You just provided a dificult to use workaround.
2/ I know about the S33560 bug and I'm already tracking it. I guess this issue will just be a duplicate of that one. But please think about the usability of this module before letting this sleep for a year or 2 like this sometimes happens.
Just my 2c, Thank you for listening,
Julien
We have closed this ticket because another page addresses its subject:
PivotGrid - Integrate the Analysis module's functionality into the PivotGrid moduleHow to provide Pivot Chart module's functionality using the Pivot Grid module
Answers approved by DevExpress Support
Hello Julien,
Here is an example of how to implement this functionality:
C#[NavigationItem("B191875")]
public class MyAnalisys : NamedBaseObject {
public MyAnalisys(Session session)
: base(session) {
}
[ValueConverter(typeof(TypeToStringConverter))]
public Type TargetObjectType {
get { return GetPropertyValue<Type>("TargetObjectType"); }
set { SetPropertyValue<Type>("TargetObjectType", value); }
}
[CriteriaObjectTypeMember("TargetObjectType")]
[Size(SizeAttribute.Unlimited)]
[Custom("RowCount", "0")]
[EditorAlias(EditorAliases.ExtendedCriteriaPropertyEditor)]
public string Criteria {
get { return GetPropertyValue<string>("Criteria"); }
set { SetPropertyValue<string>("Criteria", value); }
}
[ElementTypeProperty("TargetObjectType")]
[EditorAlias(EditorAliases.ListPropertyEditor)]
public IList Objects {
get {
IObjectSpace os = ObjectSpace.FindObjectSpaceByObject(this);
CollectionSource collectionSource = new CollectionSource(os, TargetObjectType, false, CollectionSourceMode.Proxy);
collectionSource.Criteria.Add("Analisys", CriteriaOperator.Parse(Criteria));
return (IList)collectionSource.Collection;
}
}
}
public class MyAnalisysController : ViewController<DetailView> {
internal ListPropertyEditor ObjectsPreviewEditor {
get { return View.FindItem("Objects") as ListPropertyEditor; }
}
private bool IsValidAnalisys(MyAnalisys analisys) {
return analisys != null && analisys.TargetObjectType != null;
}
private void ObjectSpace_ObjectChanged(object sender, ObjectChangedEventArgs e) {
if(object.Equals(View.CurrentObject, e.Object) && e.PropertyName == "TargetObjectType") {
ListPropertyEditor objectsPreview = ObjectsPreviewEditor;
if(objectsPreview != null && IsValidAnalisys(View.CurrentObject as MyAnalisys)) {
if(objectsPreview.Frame != null) {
objectsPreview.BreakLinksToControl(true);
objectsPreview.Frame.SetView(null);
}
objectsPreview.Model.View = GetAnalisysListViewModel(View.CurrentObject as MyAnalisys);
objectsPreview.CreateControl();
}
}
}
protected override void OnActivated() {
base.OnActivated();
ListPropertyEditor objectsPreview = ObjectsPreviewEditor;
if(objectsPreview != null && IsValidAnalisys(View.CurrentObject as MyAnalisys)) {
objectsPreview.Model.View = GetAnalisysListViewModel(View.CurrentObject as MyAnalisys);
}
View.ObjectSpace.ObjectChanged += new EventHandler<ObjectChangedEventArgs>(ObjectSpace_ObjectChanged);
}
private string GetAnalysisListViewId(MyAnalisys analisys) {
string defaultLisyViewId = Application.FindListViewId(analisys.TargetObjectType);
return defaultLisyViewId + "_MyAnalisys";
}
private IModelView GetAnalisysListViewModel(MyAnalisys myAnalisys) {
string viewId = GetAnalysisListViewId(myAnalisys);
IModelListView modelListView = Application.FindModelView(viewId) as IModelListView;
if(modelListView == null) {
modelListView = Application.Model.Views.AddNode<IModelListView>(viewId);
modelListView.ModelClass = Application.Model.BOModel.GetClass(myAnalisys.TargetObjectType);
modelListView.EditorType = typeof(PivotGridListEditor);
new DevExpress.ExpressApp.Model.NodeGenerators.ModelListViewColumnsNodesGenerator().GenerateNodes((ModelNode)modelListView.Columns);
}
return modelListView;
}
protected override void OnDeactivated() {
View.ObjectSpace.ObjectChanged -= new EventHandler<ObjectChangedEventArgs>(ObjectSpace_ObjectChanged);
base.OnDeactivated();
}
public MyAnalisysController() {
TargetObjectType = typeof(MyAnalisys);
}
}
public class TypeToStringConverter : ValueConverter {
public override object ConvertFromStorageType(object stringObjectType) {
ITypeInfo info = XafTypesInfo.Instance.FindTypeInfo(stringObjectType as string);
if(info == null) return null;
return info.Type;
}
public override object ConvertToStorageType(object objectType) {
if(objectType == null) {
return null;
}
return ((Type)objectType).FullName;
}
public override Type StorageType {
get { return typeof(string); }
}
}
Please test it, and let me know whether the results meet your requirements.
Thanks,
Anatol
What about grouping by another statistics? It is always set to Sum Grand Totals, but I want other options (Average, Max, Min, etc.).
FYI: I'm using ASP.NET Web application.
Hello Mauro,
To process your post more efficiently, I created a separate ticket on your behalf: T147300: Pivot Grid ASP.NET module - How to change the summary type. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.
Hello Julien,
Thank you for contacting us and passing your valuable feedback.
I have converted your original bug report to a question because it seems to be more appropriate here.
However, I think that I fully got your intended "message", and I will be glad to provide my comments on it.
>>I know this won't be there in 10.2 but please, do something for 11.1. This module is just not "XAF minded", the developper has to do everything.
>>XAF, is your most powerfull tool but its pivot module is just useless …
Actually, we believe that we addressed the two issues you highlighted in the 10.2 release. Gary, our evangelist, already provided basic information about upcoming improvements with regard to analyzing data in this blog post:
http://community.devexpress.com/blogs/garyshort/archive/2010/08/12/xaf-pivot-grid-amp-chart-list-editors-coming-in-v2010-vol-2.aspx
Starting from 10.2, you will be able to easily specify any option you want in the designer, either at runtime or at design time, via the Model Editor.
There also additional menus have been added to control totals visibility. Attached is a screenshot, showing some of these options.
Please let me know if you have additional questions.
Thanks,
Dennis
Dennis,
I missed that post ! Oh my …
You guys are amzing !
I don't close this issue right now, I'm waiting to see it in action (Hope to see a beta soon!)
Will it be possible to call the pivot wizard from the Analysis detail view or is it just accessible via the model editor ?
Well, I stop asking question and just wait patiently for the 10.2 beta …
Many thanks,
Julien
Hello Julien,
>>I don't close this issue right now, I'm waiting to see it in action (Hope to see a beta soon!)
Feel free to reactivate this ticket when you want.
>>Will it be possible to call the pivot wizard from the Analysis detail view or is it just accessible via the model editor ?
As I already mentioned, this wizard is accessible from both Model Editor and pivot grid ListView. Please refer to the previous screenshot.
Thanks,
Dennis
Hi Dennis,
Any way to get the wizard in an Analysis created by a end user ?
My users would like to create some stats, but they just can't group by date, for a pivot grid, it's a bit counter productive …
Thanks,
Julien
Hi Julien,
It is possible to invoke a Wizard at runtime via right-clicking the corresponding menu option. Please check the FeatureCenter -> List Editors -> PivotGrid -> Sales Analysis demo module, and try this feature yourself. Should you need further clarification, feel free to ask. We will be glad to help you.
Thanks,
Alex
Hi Alex,
I was talking about analysis created with the Pivot Chart module.
It's the easiest way for an end user to create a statistic, but those limitations make it practically unusable.
Thanks,
Julien
Hello Julien,
I apologize for the misunderstanding.
The improvements we introduced are only related to the PivotGridListEditor, included in the Pivot Grid module. We are planning to work in this direction to improve the capabilities of XAF cross-tabulated reports. The Pivot Chart module will unlikely be improved. Please try to use the Pivot Grid module for your needs and let us know in case of any difficulty.
Thanks,
Anatol
Hi Anatol,
The main advantage of the Pivot Chart module is its ability to create new Analysis without executing the model editor.
It's very difficult for an end user to understand the philosophy behing the model editor, they won't ba able to create new chart by themselves.
Please, provide a way to easily create a new pivot. That would make this module very powerful as the end users often know more than the devs what are the statictics to be created.
In the meantime, the users will just come to me and ask me to create the anaysis for them.
Many thanks for listening,
Julien
Hello Julien,
We will try to create an example, demonstrating how to accomplish this task. I have created a corresponding suggestion: Modules - Provide a module similar to the Analysis module, and take advantages of the new PivotGrid and Chart List Editors in it.
I also suggest that you review our KPI module, which allows you to accomplish a similar task.
Thanks,
Anatol