Applying strict currency formats and custom header rows when exporting SfPivotView to Excel?

Building a year-end corporate financial reporting dashboard using Blazor WebAssembly and the Syncfusion component suite. The core feature relies heavily on the SfPivotView component to aggregate thousands of transactional records by region and expense category.


To ensure compliance and seamless auditing, we are coordinating with a Canadian accounting firm that requires the exported data to map exactly to their internal macro-enabled workbooks for corporate tax filing.


This strict requirement is causing some friction with the default Excel export functionality in SfPivotView. I need to intercept and modify the export stream to match their templates perfectly.


  1. When triggering ExportToExcelAsync(), is there a supported way to inject custom header rows (e.g., company name, dynamic date range, and a static tax ID) at the very top of the Excel worksheet before the actual pivot data begins?
  2. How can I enforce strict currency cell formatting in the exported Excel file so that large aggregated values don't accidentally convert to scientific notation or lose their specific locale currency symbol in the resulting .xlsx file?


Looking for the cleanest way to handle this on the client side using Syncfusion's built-in export events, without having to route the data back to the server to process it with something like EPPlus.


1 Reply

KM Karthickraja MuthuRaman Syncfusion Team July 13, 2026 12:11 PM UTC

Hi Ammaraamer,


Thank you for contacting the Syncfusion Support. We have reviewed and validated your query. Please find our response below.


Query

Response

Dynamic Header Injection

We understand that you would like to include row headers in the exported Pivot Table.

In this case, we would like to inform you that the Pivot Table component provides support for adding custom headers and footers to the exported Excel document, allowing you to include additional information such as row header details, report titles, or other contextual content.

 

To add a header, configure the Header property within the ExcelExportProperties object and pass it to the ExportToExcelAsync method during the export operation. The specified header content will then be included in the exported Excel file.

 

Please refer to the following code example for reference:

 

Code Example:

[Home.razor]

@code {

    public async Task OnExport()

    {

        ExcelExportProperties ExportProperties = new ExcelExportProperties();

        ExcelHeader header = new ExcelHeader();

        List<ExcelRow> headerContent = new List<ExcelRow>

        {

           

            new ExcelRow()

            {

                Cells = new List<ExcelCell>()

                {

                    new ExcelCell()

                    {

                        Value = "ABC Corporation",

                        ColSpan = 13,

                        Style = new Syncfusion.Blazor.Grids.ExcelStyle()

                        {

                            Bold = true,

                            FontSize = 20,

                            HAlign = Syncfusion.Blazor.Grids.ExcelHorizontalAlign.Center

                        }

                    }

                }

            },

            ...

        };

        ExcelExportProperties excelExportProperties = new ExcelExportProperties()

        {

            FileName = "sample.xlsx",

            Header = header,

        };

        await this.pivot.ExportToExcelAsync(excelExportProperties);

    }

}

 

 

Output:

 

Strict Currency Formatting

We understand that you would like to display the aggregated values in currency format. In this case, we would like to inform you that the Pivot Table component provides support for defining currency formats through the FormatSettings property, which are applied to the exported Excel document as well. This helps maintain consistent formatting for currency values during the export process. Please refer to the following code example:

 

Code Example:

[Home.razor]

<SfPivotView ... >

    <PivotViewDataSourceSettings TValue="PivotVirtualData" DataSource="@data">

        ...

        <PivotViewFormatSettings>

            <PivotViewFormatSetting Name="Price" Format="C2"></PivotViewFormatSetting>

        </PivotViewFormatSettings>

    </PivotViewDataSourceSettings>

</SfPivotView>

 

 

Output:

 


In the meantime, we have prepared and attached a sample for your reference.


Furthermore, you can refer to the user guide documentation provided below for more information about the related topics:

Add header and footer while exporting: https://blazor.syncfusion.com/documentation/pivot-table/excel-export#add-header-and-footer-while-exporting

Format settings: https://blazor.syncfusion.com/documentation/pivot-table/number-formatting#defining-number-format-settings


if you have any further questions or require additional assistance, please don’t hesitate to reach out to our support team. We’re always here to help.


Regards,

Karthickraja M


Attachment: Blazor_3ac712b2.zip

Loader.
Up arrow icon