# spreadsheet-exporting

> SfSpreadsheet with export functionality to Excel, PDF, and CSV formats with format preservation.

**Framework:** wpf  **Component:** Spreadsheet  **Variant:** exporting

## Get this item

**If you are an agent, fetch the JSON.** Source is inlined, so one request is enough and no tooling is required:

```
GET https://ai.syncfusion.com/r/wpf/spreadsheet-exporting.json
```

**Install Package(s)**

```bash
dotnet add package Syncfusion.SfSpreadsheet.WPF
```

**Notes**

- Syncfusion release: 2026 Volume 3 (v35.1.37)
- The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md

## Source files

### src/components/spreadsheet-exporting/Spreadsheet.xaml

```xaml
<UserControl
    x:Class="SpreadsheetExporting.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
    SnapsToDevicePixels="True">

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="3*" />
            <ColumnDefinition Width="260" />
        </Grid.ColumnDefinitions>

        <!-- The workbook that is exported -->
        <syncfusion:SfSpreadsheet x:Name="spreadsheetControl"
                                  Grid.Column="0"
                                  Margin="8"
                                  FormulaBarVisibility="Collapsed"
                                  WorkbookLoaded="spreadsheetControl_WorkbookLoaded" />

        <!-- The export options -->
        <Border Grid.Column="1"
                Margin="0,8,8,8"
                Padding="12"
                BorderBrush="#D5DCE4"
                BorderThickness="1"
                Background="White">
            <DockPanel>
                <StackPanel DockPanel.Dock="Bottom" Margin="0,12,0,0">
                    <Button x:Name="exportButton"
                            Padding="12,6"
                            Click="exportButton_Click"
                            Content="Export" />
                    <TextBlock x:Name="statusTextBlock"
                               Margin="0,8,0,0"
                               TextWrapping="Wrap"
                               Foreground="#52606D" />
                </StackPanel>

                <StackPanel>
                    <TextBlock Margin="0,0,0,4"
                               FontSize="15"
                               FontWeight="Bold"
                               Text="Exporting Options" />

                    <RadioButton x:Name="htmlRadioButton"
                                 Margin="0,10,0,0"
                                 GroupName="exportFormat"
                                 IsChecked="True"
                                 Content="Export to HTML" />
                    <RadioButton x:Name="imageRadioButton"
                                 Margin="0,8,0,0"
                                 GroupName="exportFormat"
                                 Content="Export to Image" />
                    <RadioButton x:Name="pdfRadioButton"
                                 Margin="0,8,0,0"
                                 GroupName="exportFormat"
                                 Content="Export to PDF" />

                    <TextBlock x:Name="summaryTextBlock"
                               Margin="0,14,0,0"
                               TextWrapping="Wrap"
                               Foreground="#7B8794" />
                </StackPanel>
            </DockPanel>
        </Border>
    </Grid>
</UserControl>

```
