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. Image for the cookie policy date

PivotViewFormatSetting and PivotViewCalculatedFieldSetting with ExpandoObject does not work

Hi Syncfusion Team,

attached sample project does not work. What am I doing wrong?

Can you help me please?

Thank's in advance

Gisela



Attachment: Syncfusion_Pivot_4e8baa19.zip

3 Replies 1 reply marked as answer

AP AngelinFaithSheeba PaulvannanRajadurai Syncfusion Team November 22, 2022 02:28 PM UTC

Hi Gisela,


The reported issue occurs due to the PivotViewFormatSettings and PivotViewCalculatedField are defined outside of the PivotViewDataSourceSettings tag, while they should be used inside of that tag instead. Please refer the code snippet below.


Code Example:

<SfPivotView TValue="ExpandoObject" Height="560" Width="100%" AllowCalculatedField=true>

    <PivotViewDataSourceSettings DataSource="@Orders">

       <PivotViewFormatSettings>

           <PivotViewFormatSetting Name="Freight" Format="N0" UseGrouping="false" ></PivotViewFormatSetting>

               <PivotViewFormatSetting Name="FreightAdd" Format="N0" UseGrouping="false"></PivotViewFormatSetting>

        </PivotViewFormatSettings>

        <PivotViewCalculatedFieldSettings>

            <PivotViewCalculatedFieldSetting Name="FreightAdd" Formula="@f_add"></PivotViewCalculatedFieldSetting>

        </PivotViewCalculatedFieldSettings>

    </PivotViewDataSourceSettings>

</SfPivotView>


Meanwhile, we have modified your sample for your reference.


Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/Syncfusion_Pivot-630089751


Please see the below UG document for more information on the PivotViewFormatSettings and PivotViewCalculatedField property.


PivotViewFormatSettings: https://blazor.syncfusion.com/documentation/pivot-table/number-formatting

PivotViewCalculatedField: https://blazor.syncfusion.com/documentation/pivot-table/calculated-field


Please let us know if you have any concerns.


Regards,

Angelin Faith Sheeba


Marked as answer

GI gisela November 28, 2022 11:52 AM UTC

Thank you



AP AngelinFaithSheeba PaulvannanRajadurai Syncfusion Team November 29, 2022 08:13 AM UTC

Hi Gisela,


Please contact us if you have any other queries. We are always happy to assist you.


Loader.
Live Chat Icon For mobile
Up arrow icon