This is a migrated thread and some comments may be shown as answers.

PivotGrid export to excel gibberish

1 Answer 105 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 01 Jun 2017, 06:45 PM

I have a pivot grid bound to a sql data source. When I attempt to export, the resulting excel file is gibberish (see screenshot). My version is 2017.1.118. What am I missing?

    <telerik:RadPivotGrid ID="rpgResults" runat="server" DataSourceID="sdsSummary" Width="100%"
        EnableTheming="false" EnableEmbeddedSkins="true" Skin="Default" RenderMode="Lightweight"
        AllowFiltering="False" AggregatesPosition="Columns" ShowFilterHeaderZone="False" ShowDataHeaderZone="False" ShowColumnHeaderZone="False" ShowRowHeaderZone="False"
        OnCellDataBound="RadPivotGrid1_CellDataBound"> 
        <ClientSettings>
            <Scrolling AllowVerticalScroll="True" ScrollHeight="600px" />
        </ClientSettings>
        <Fields>
            <telerik:PivotGridRowField DataField="Year" />
            <telerik:PivotGridRowField DataField="Qtr" />
            <telerik:PivotGridRowField DataField="Month" SortOrder="None" />
            <telerik:PivotGridColumnField DataField="InvoiceType" />
            <telerik:PivotGridAggregateField  DataField="Amount" Aggregate="Sum" DataFormatString="{0:C}" />
            <telerik:PivotGridAggregateField DataField="Invoices" Aggregate="Count" DataFormatString="{0:N0}" />
        </Fields>
    </telerik:RadPivotGrid>

button click code for exporting...

        rpgResults.ExportSettings.Excel.Format = PivotGridExcelFormat.Biff
        rpgResults.ExportSettings.FileName = "Processed_Invoice_Summary"
        rpgResults.ExportSettings.IgnorePaging = True
        rpgResults.ExportSettings.OpenInNewWindow = False
        rpgResults.ExportToExcel()

1 Answer, 1 is accepted

Sort by
0
John
Top achievements
Rank 1
answered on 05 Jun 2017, 08:15 PM
I solved this in case anyone else has the same issue. I had some site-wide content-encoding added for compression. Once I disabled it for my page in question, the export worked.
Tags
PivotGrid
Asked by
John
Top achievements
Rank 1
Answers by
John
Top achievements
Rank 1
Share this question
or