We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Amount not shown in PivotGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

120634 Sep 29,2015 03:32 AM Oct 26,2015 08:05 AM Windows Forms 5
loading
Tags: PivotGridControl
CHAIRAT YANWITTAYAKOOL
Asked On September 29, 2015 03:32 AM

Hello, I try to use PivotGridControl and bind ItemSource with DataTable. All fields can display except "Amount".
My DataTable result looks like this:

Sect Year Month Quarter Amount
SA-MSD2014 11 Q1 21375
SA-MSD 2015 2 Q2 1668675
SA-MSD 2015 3 Q2 673000
SA-MSD2015 4 Q3 0
SA-MSD2015 5 Q3 16400000
SA-MSD 2015 6 Q3 37000
SA-MSD 2015 8 Q4 2390000
SA-MSD 2015 9 Q4 187362.5


And Code to initialize grid control looks like this:
public void InitializeGridControl()
{
this.pgcResult.ItemSource = dt;
this.pgcResult.GridVisualStyles = Syncfusion.Windows.Forms.GridVisualStyles.Metro;
//this.MetroColor = System.Drawing.Color.Transparent;
// Adding Pivot Rows to Grid
this.pgcResult.PivotRows.Add(new PivotItem { FieldMappingName = "Sect", TotalHeader = "Total" });
this.pgcResult.PivotRows.Add(new PivotItem { FieldMappingName = "Year", TotalHeader = "Total" });
//Adding Pivot Columns to Grid
this.pgcResult.PivotColumns.Add(new PivotItem { FieldMappingName = "Quarter", TotalHeader = "Total" });
this.pgcResult.PivotColumns.Add(new PivotItem { FieldMappingName = "Month", TotalHeader = "Total" });
//Adding PivotCalculations to Grid
this.pgcResult.PivotCalculations.Add(new PivotComputationInfo { FieldName = "Amount", Format = "#,##0", SummaryType = SummaryType.DoubleTotalSum });
}





And this is result:
pivotgrid
Please give any suggestion to resolve a problem. Thanks.

Solai A L [Syncfusion]
Replied On September 30, 2015 08:41 AM

Hi Chairat,

Thank you for using Syncfusion Products. 

We had analyzed your query and the image provided is not visible. So, please share the image via attachment, zipped/Rar format. We have prepared a similar sample using the data table. Please refer to the sample and update whether it is the same problem.

Sample: 
http://www.syncfusion.com/downloads/support/forum/120634/ze/CS-1380245317.


Thanks & Regards,
AL.Solai.


CHAIRAT YANWITTAYAKOOL
Replied On September 30, 2015 10:32 PM

I attach image again.
Attachment: PivotGrid_cef1cf57.zip

Solai A L [Syncfusion]
Replied On October 6, 2015 07:36 AM

Hi Chairat,

The Pivot Calculations column will be visible based on the property ShowCalculationsAsColumns and it is set to true by default. If the Calculation column is not visible, the data isn’t related properly. Refer to the following sample and image. If such correlation is not correct, then the column would  be missing. So, please change the data accordingly.

Sample location :
C:\Users\<user>\AppData\Local\Syncfusion\EssentialStudio\<version>\Windows\PivotGrid.Windows\Samples\Appearance\Pivot Grid Demo\CS


Thanks & Regards,
AL.Solai.

CHAIRAT YANWITTAYAKOOL
Replied On October 23, 2015 11:15 PM

Hi AL.Solai.,

  Thanks for your reply. Problem has been solve. But I found another problem about loading data again.
When I click button to call InitializeGridControl() at first time, Pivot works fine. But when call it again, It throw exception like this at line:

this.pgcResult.PivotCalculations.Add(new PivotComputationInfo { FieldName = "Amount", Format = "#,###.#0", SummaryType = SummaryType.DoubleTotalSum });

Exception 1

Exception 2

I try to use this code to clear all data before call function but it still same error. 

            this.pgcResult.PivotColumns.Clear();
            this.pgcResult.PivotRows.Clear();
            this.pgcResult.PivotCalculations.Clear();
            this.pgcResult.TableModel.Clear(true);

Do you have any suggestion?

Attachment: Exception_7e10ed22.zip

Solai A L [Syncfusion]
Replied On October 26, 2015 08:05 AM

Hi Chairat,

Thank you for your update.

We created an incident for this query in our DT support for better communication. So, please login our DT support.
Link :
http://www.syncfusion.com/support/directtrac/incidents


Thanks & Regards,
AL.Solai.


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;