0

i would like to explain my circumstance briefly, I use DashboardViwer item and i load xml to it onload which has been created and saved by DashboardDesigner.

Then, i fill DashboardObjectDataSource and i add it to dashboard data source to set it to items.

Finaly, i open some properties and activere customizationform for PivotGridControl which inside dashboard viewer.

i see the report result correctly acording to my design that has been created by dashboard designer.

But, when i want to change field orders or place i get this exceptions;

Object Referance

   position: DevExpress.XtraPivotGrid.Data.PivotFieldCellValueItem.GetTextCore()
   position: DevExpress.XtraPivotGrid.Data.PivotFieldValueItem.GetCustomText(Boolean calculateIsCustomDisplayText)
   position: DevExpress.XtraPivotGrid.Data.PivotFieldValueItem.CalculateText()
   position: DevExpress.XtraPivotGrid.Data.PivotFieldValueItem.get_Text()
   position: DevExpress.XtraPivotGrid.Data.PivotFieldValueItem.get_DisplayText()
   position: DevExpress.XtraPivotGrid.ViewInfo.PivotFieldsAreaCellViewInfo.get_DisplayText()
   position: DevExpress.XtraPivotGrid.ViewInfo.PivotFieldsAreaCellViewInfoBase.CreateHeaderInfoArgs(GraphicsCache graphicsCache)
   position: DevExpress.XtraPivotGrid.ViewInfo.PivotFieldsAreaCellViewInfoBase.InternalPaint(ViewInfoPaintArgs e)
   position: DevExpress.XtraPivotGrid.ViewInfo.BaseViewInfo.Paint(ViewInfoPaintArgs e)
   position: DevExpress.XtraPivotGrid.ViewInfo.BaseViewInfoCollection.Paint(ViewInfoPaintArgs e)
   position: DevExpress.XtraPivotGrid.ViewInfo.BaseViewInfo.PaintChildren(ViewInfoPaintArgs e)
   position: DevExpress.XtraPivotGrid.ViewInfo.BaseViewInfo.Paint(ViewInfoPaintArgs e)
   position: DevExpress.XtraPivotGrid.ViewInfo.BaseViewInfoCollection.Paint(ViewInfoPaintArgs e)
   position: DevExpress.XtraPivotGrid.ViewInfo.BaseViewInfo.PaintChildren(ViewInfoPaintArgs e)
   position: DevExpress.XtraPivotGrid.ViewInfo.BaseViewInfo.Paint(ViewInfoPaintArgs e)
   position: DevExpress.XtraPivotGrid.ViewInfo.BaseViewInfoControl.OnPaint(PaintEventArgs e)
   position: DevExpress.XtraPivotGrid.PivotGridControl.OnPaint(PaintEventArgs e)
   position: System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
   position: System.Windows.Forms.Control.WmPaint(Message& m)
   position: System.Windows.Forms.Control.WndProc(Message& m)
   position: DevExpress.XtraPivotGrid.PivotGridControl.WndProc(Message& m)
   position: System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   position: System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   position: System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Dashboard Viewer Item data source

[C#]

lSales = oSales.GetReport(filter); // fill list and set default values if it is null
dashboardViewerCreation.Dashboard.DataSources.Clear();
oDashboardObjectDataSource = new DashboardObjectDataSource(dashTitle, lSales);
dashboardViewerCreation.Dashboard.DataSources.Add(oDashboardObjectDataSource);

//Control each item and set data source
foreach (DashboardItem dashboardItem in dashboardViewerCreation.Dashboard.Items)
{
    if (dashboardItem.GetType() == typeof(PivotDashboardItem))
    {
        ((PivotDashboardItem)dashboardItem).DataSource = oDashboardObjectDataSource;
    }

}

dashboardViewerCreation.ReloadData(true);
dashboardViewerCreation.Refresh();

Dashboard Viever Item events

[C#]

private void dashboardViewerCreation_DashboardItemControlCreated(object sender, DevExpress.DashboardWin.DashboardItemControlEventArgs e)
    {
        if (e.PivotGridControl != null)
        {
            e.PivotGridControl.OptionsCustomization.AllowPrefilter = false;
            e.PivotGridControl.OptionsCustomization.AllowDrag = true;
            e.PivotGridControl.OptionsCustomization.AllowEdit = false;
            e.PivotGridControl.OptionsCustomization.AllowExpand = true;
            e.PivotGridControl.OptionsCustomization.AllowExpandOnDoubleClick = true;
            e.PivotGridControl.OptionsCustomization.AllowFilter = false;

            e.PivotGridControl.OptionsCustomization.AllowCustomizationForm = true;
            e.PivotGridControl.OptionsCustomization.AllowDragInCustomizationForm = true;

            e.PivotGridControl.OptionsBehavior.CopyToClipboardWithFieldValues = true;
            e.PivotGridControl.OptionsBehavior.ApplyBestFitOnFieldDragging = true;
            e.PivotGridControl.OptionsBehavior.HorizontalScrolling = PivotGridScrolling.Control;


            e.PivotGridControl.OptionsMenu.EnableFieldValueMenu = false;
            e.PivotGridControl.OptionsMenu.EnableFormatRulesMenu = false;

            e.PivotGridControl.OptionsView.ShowDataHeaders = true;
            e.PivotGridControl.OptionsView.ShowRowHeaders = true;
            e.PivotGridControl.OptionsView.ShowColumnHeaders = true;
            e.PivotGridControl.OptionsView.ShowFilterHeaders = true;
            e.PivotGridControl.OptionsView.ShowFilterSeparatorBar = true;
            e.PivotGridControl.OptionsView.ShowRowGrandTotals = true;
            e.PivotGridControl.OptionsView.ShowColumnTotals = true;

            e.PivotGridControl.OptionsCustomization.CustomizationFormLayout = CustomizationFormLayout.StackedDefault;
            e.PivotGridControl.OptionsCustomization.CustomizationFormStyle = CustomizationFormStyle.Excel2007;
            
            e.PivotGridControl.ShowingCustomizationForm += PivotGridControlOnShowingCustomizationForm;

        }
    }

       
private void PivotGridControlOnShowingCustomizationForm(object sender, CustomizationFormShowingEventArgs customizationFormShowingEventArgs)
    {
        customizationFormShowingEventArgs.ParentControl = splitContainerControl1.Panel1;
        customizationFormShowingEventArgs.CustomizationForm.Dock = DockStyle.Fill;
    }
Community
  • 1
  • 1
berkay
  • 21
  • 10

1 Answers1

0

Sergi (DevExpress Support);

In the current version, Dashboard Pivot Grid Item does not support the Customization Form functionality. Therefore, if you display it manually using the API of the inner pivot grid control, Customization Form may work incorrectly, or exception will be thrown as in your case.

Currently, it is possible to reorder dimensions and measures in Pivot Grid Item using the Dashboard Designer. If this approach does not meet your requirements, would you please describe your scenario in greater detail? We look forward to hearing from you.


John (DevExpress Support);

The DashboardViewer control was designed only to display dashboards. That's why there is no simple way to use the PivotGrid control's customization capabilities in DashboardViewer. To customize dashboards in the required manner, you would need to use the DashboardDesigner control.

Community
  • 1
  • 1
berkay
  • 21
  • 10