Ticket B191875
Visible to All Users
Duplicate

We have closed this ticket because another page addresses its subject:

PivotGrid - Integrate the Analysis module's functionality into the PivotGrid module

How to provide Pivot Chart module's functionality using the Pivot Grid module

created 14 years ago

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

Show previous comments (6)
Anatol (DevExpress) 14 years ago

    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

      Anatol (DevExpress) 14 years ago

        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

        Answers approved by DevExpress Support

        created 14 years ago (modified 10 years ago)

        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

          Show previous comments (3)
          Anatol (DevExpress) 12 years ago

            Thank you for your feedback, Raoul. Feel free to post your code here.

              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.

              Anatol (DevExpress) 11 years ago

                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.

                Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

                Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.