Skip to content

syncfusion/blazor-ui-components-skills / skills/syncfusion-blazor-pivot-table

syncfusion-blazor-pivot-table

Verified

Use this skill when users ask how to implement Syncfusion Pivot Table/PivotView in Blazor. Trigger for Blazor components, data binding, OLAP analysis, aggregation, drill-down/drill-through, grouping, filtering, conditional formatting, exports (Excel/PDF/CSV), or pivot charts. Blazor-only, not React/Angular/Vue/JS.

references/pdf-export.md

View on GitHub
# PDF Export — Syncfusion Blazor Pivot Table

PDF export allows you to generate high-quality PDF documents from the pivot table with customizable page orientation, themes, and formatting.

## PDF Export

Enable with `AllowPdfExport="true"` and call `ExportToPdfAsync()`:

```razor
@using Syncfusion.Blazor.PivotView
@using Syncfusion.Blazor.Buttons

<SfButton OnClick="OnPdfExport" Content="Export to PDF"></SfButton>

<SfPivotView TValue="ProductDetails" @ref="pivot" AllowPdfExport="true">
    <PivotViewDataSourceSettings DataSource="@data">
        ...
    </PivotViewDataSourceSettings>
</SfPivotView>

@code {
    SfPivotView<ProductDetails> pivot;
    public List<ProductDetails> data { get; set; }
    protected override void OnInitialized() => data = ProductDetails.GetProductData().ToList();

    public void OnPdfExport() => pivot.ExportToPdfAsync();
}
```

## PDF Export with Customization

### Page Orientation and Theme

```razor
@code {
    public async Task OnPdfExport()
    {
        var exportProperties = new PdfExportProperties
        {
            FileName = "SalesReport.pdf",
            PageOrientation = PageOrientation.Landscape,
            Theme = new PdfTheme
            {
                Header = new PdfThemeStyle { Bold = true, FontSize = 14 },
                Record = new PdfThemeStyle { FontSize = 10 }
            }
        };
        await pivot.ExportToPdfAsync(exportProperties);
    }
}
```

## Export Chart with Table

When both the pivot grid and pivot chart are visible, export them together:

```razor
<SfPivotView TValue="ProductDetails" @ref="pivot"
             AllowPdfExport="true" AllowExcelExport="true">
    <PivotViewDisplayOption View="View.Both" Primary="Primary.Table">
    </PivotViewDisplayOption>
    ...
</SfPivotView>

@code {
    // Export both grid and chart to PDF on the same page
    public void ExportAll() => pivot.ExportToPdfAsync();
}
```

## Export as Memory Stream

Pass `true` to get a `MemoryStream` instead of downloading — useful for server-side file generation or email attachments:

```razor
@code {
    public async Task ExportToStream()
    {
        // Returns MemoryStream — save to disk, email, or upload to storage
        MemoryStream stream = await pivot.ExportToPdfAsync(true) as MemoryStream;
        // e.g., save to file:
        await File.WriteAllBytesAsync("output.pdf", stream.ToArray());
    }
}
```
deprecation-and-migrationaddyosmani/agent-skillsManages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
performance-optimizationaddyosmani/agent-skillsOptimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
Agent Cost Reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json.Stars: 118kUpdated Claude CodeCodexVerifiedInstall
Agent Cost Reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json.Stars: 118kUpdated Claude CodeCodexVerifiedInstall