Ejemplo n.º 1
0
 public void Update(Analysis analysis)
 {
     if (analysis != null && !PivotGridSettingsHelper.HasPivotGridSettings(analysis))
     {
         IAnalysisControl control = CreateAnalysisControl();
         control.DataSource = new AnalysisDataSource(analysis, objectSpace.GetObjects(typeof(DemoTask)));
         control.Fields["Priority"].Area = DevExpress.XtraPivotGrid.PivotArea.ColumnArea;
         control.Fields["Subject"].Area  = DevExpress.XtraPivotGrid.PivotArea.DataArea;
         control.Fields["AssignedTo.DisplayName"].Area = DevExpress.XtraPivotGrid.PivotArea.RowArea;
         PivotGridSettingsHelper.SavePivotGridSettings(CreatePivotGridSettingsStore(control), analysis);
     }
 }
Ejemplo n.º 2
0
 protected override void CustomSort(IAnalysisControl analysisControl, IMemberInfo memberInfo){
     ASPxPivotGrid pivotGridControl = ((AnalysisControlWeb)analysisControl).PivotGrid;
     pivotGridControl.CustomFieldSort += (sender, args) =>{
         var pivotedSortAttribute = memberInfo.FindAttributes<PivotedSortAttribute>().SingleOrDefault(attribute => attribute.PropertyName == args.Field.FieldName);
         if (pivotedSortAttribute != null){
             var compareResult = GetCompareResult(pivotedSortAttribute.SortDirection,
                 args.GetListSourceColumnValue(args.ListSourceRowIndex1, pivotedSortAttribute.SortPropertyName),
                 args.GetListSourceColumnValue(args.ListSourceRowIndex2, pivotedSortAttribute.SortPropertyName));
             args.Result = compareResult;
             args.Handled = true;
         }
     };
 }
Ejemplo n.º 3
0
 public void Update(Analysis analysis)
 {
     if (analysis != null && !PivotGridSettingsHelper.HasPivotGridSettings(analysis))
     {
         IAnalysisControl control = CreateAnalysisControl();
         control.DataSource = new AnalysisDataSource(analysis, new XPCollection <crmPaymentPlan>(analysis.Session));
         //Customize the settings of the control's fields (their caption, etc.) as required
         control.Fields["Priority"].Area = DevExpress.XtraPivotGrid.PivotArea.ColumnArea;
         control.Fields["Subject"].Area  = DevExpress.XtraPivotGrid.PivotArea.DataArea;
         control.Fields["AssignedTo.DisplayName"].Area = DevExpress.XtraPivotGrid.PivotArea.RowArea;
         PivotGridSettingsHelper.SavePivotGridSettings(CreatePivotGridSettingsStore(control), analysis);
         analysis.Save();
     }
 }
Ejemplo n.º 4
0
 public void Update(Analysis analysis)
 {
     if (analysis != null && !PivotGridSettingsHelper.HasPivotGridSettings(analysis))
     {
         IAnalysisControl control = CreateAnalysisControl();
         control.DataSource                            = new AnalysisDataSource(analysis, new XPCollection <DemoTask>(analysis.Session));
         control.Fields["Status"].Area                 = DevExpress.XtraPivotGrid.PivotArea.ColumnArea;
         control.Fields["Priority"].Area               = DevExpress.XtraPivotGrid.PivotArea.ColumnArea;
         control.Fields["EstimatedWork"].Area          = DevExpress.XtraPivotGrid.PivotArea.DataArea;
         control.Fields["ActualWork"].Area             = DevExpress.XtraPivotGrid.PivotArea.DataArea;
         control.Fields["AssignedTo.DisplayName"].Area = DevExpress.XtraPivotGrid.PivotArea.RowArea;
         PivotGridSettingsHelper.SavePivotGridSettings(CreatePivotGridSettingsStore(control), analysis);
     }
 }
Ejemplo n.º 5
0
 protected virtual void OnAnalysisControlCreated()
 {
     UpdateActionState();
     foreach (AnalysisEditorBase analysisEditor in analysisEditors)
     {
         IAnalysisControl analysisControl = analysisEditor.Control;
         if (!(((ISupportPivotGridFieldBuilder)analysisControl).FieldBuilder is PivotGridFieldBuilder))
         {
             var pivotGridFieldBuilder = new PivotGridFieldBuilder(analysisControl);
             pivotGridFieldBuilder.SetModel(Application.Model);
             ((ISupportPivotGridFieldBuilder)analysisControl).FieldBuilder = pivotGridFieldBuilder;
         }
         analysisEditor.IsDataSourceReadyChanged += analysisEditor_IsDataSourceReadyChanged;
     }
 }
Ejemplo n.º 6
0
        void AnalysisEditorOnControlCreated(object sender, EventArgs eventArgs)
        {
            var analysisEditor = ((AnalysisEditorBase)sender);

            analysisEditor.ControlCreated -= AnalysisEditorOnControlCreated;
            IAnalysisControl analysisControl = analysisEditor.Control;

            if (!(((ISupportPivotGridFieldBuilder)analysisControl).FieldBuilder is PivotGridFieldBuilder))
            {
                var pivotGridFieldBuilder = new PivotGridFieldBuilder(analysisControl);
                pivotGridFieldBuilder.SetModel(Application.Model);
                ((ISupportPivotGridFieldBuilder)analysisControl).FieldBuilder = pivotGridFieldBuilder;
            }
            analysisEditor.IsDataSourceReadyChanged += analysisEditor_IsDataSourceReadyChanged;
        }
Ejemplo n.º 7
0
        protected override void CustomSort(IAnalysisControl analysisControl, IMemberInfo memberInfo)
        {
            ASPxPivotGrid pivotGridControl = ((AnalysisControlWeb)analysisControl).PivotGrid;

            pivotGridControl.CustomFieldSort += (sender, args) => {
                var pivotedSortAttribute = memberInfo.FindAttributes <PivotedSortAttribute>().SingleOrDefault(attribute => attribute.PropertyName == args.Field.FieldName);
                if (pivotedSortAttribute != null)
                {
                    var compareResult = GetCompareResult(pivotedSortAttribute.SortDirection,
                                                         args.GetListSourceColumnValue(args.ListSourceRowIndex1, pivotedSortAttribute.SortPropertyName),
                                                         args.GetListSourceColumnValue(args.ListSourceRowIndex2, pivotedSortAttribute.SortPropertyName));
                    args.Result  = compareResult;
                    args.Handled = true;
                }
            };
        }
Ejemplo n.º 8
0
 protected abstract IPivotGridSettingsStore CreatePivotGridSettingsStore(IAnalysisControl control);
Ejemplo n.º 9
0
 protected override DevExpress.Persistent.Base.IPivotGridSettingsStore CreatePivotGridSettingsStore(IAnalysisControl control)
 {
     return(new ASPxPivotGridSettingsStore(((AnalysisControlWeb)control).PivotGrid));
 }
Ejemplo n.º 10
0
 protected override DevExpress.Persistent.Base.IPivotGridSettingsStore CreatePivotGridSettingsStore(IAnalysisControl control)
 {
     return new PivotGridControlSettingsStore(((AnalysisControlWin)control).PivotGrid);
 }
Ejemplo n.º 11
0
 public PivotGridFieldBuilder(IAnalysisControl analysisControl,Func<string,PivotGroupInterval> func) 
     : base(analysisControl) {
     _func = func;
 }
Ejemplo n.º 12
0
 protected abstract void CustomSort(IAnalysisControl analysisControl, IMemberInfo memberInfo);
Ejemplo n.º 13
0
 protected abstract void CustomSort(IAnalysisControl analysisControl, IMemberInfo memberInfo);
Ejemplo n.º 14
0
 public PivotGridFieldBuilder(IAnalysisControl analysisControl)
     : base(analysisControl)
 {
 }
Ejemplo n.º 15
0
 public MyPivotGridFieldBuilder(IAnalysisControl owner) : base(owner)
 {
 }
Ejemplo n.º 16
0
 public PivotGridFieldBuilder(IAnalysisControl analysisControl)
     : base(analysisControl)
 {
 }
Ejemplo n.º 17
0
		protected abstract IPivotGridSettingsStore CreatePivotGridSettingsStore(IAnalysisControl control);
 public CustomPivotFieldBuilder(IAnalysisControl owner) : base(owner)
 {
 }