New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Export RadPivotGrid



empty
QuantityYearQuarter
ProductName
19971997 Total 19981998 TotalGrand Total
Quarter 1Quarter 2Quarter 3Quarter 4Quarter 1Quarter 2
26.7534.5021.0036.0029.2814.2244.5019.7325.66
19.0019.8833.671.0023.8435.4318.3330.3025.69
40.0036.2526.6715.0031.6736.6021.7530.0030.90
30.0027.6719.8630.0023.5014.0017.6715.1019.68
15.338.3316.0049.3321.7731.7120.0030.2525.00
26.0123.6923.4423.6424.1323.5125.9924.2924.19
Alice Mutton
Boston Crab Meat
Camembert Pierrot
Carnarvon Tigers
Chartreuse verte
Grand Total
Page 1 of 15

You could easily export the RadPivotGrid control with the RadClientExportManager to PDF (as shown in the demo) and to an image. You can also use the skin chooser to change the appearance of the component and export the new appearance.

  • DefaultCS.aspx
  • DefaultCS.aspx.cs
<%@ Page AutoEventWireup="true" CodeFile="DefaultCS.aspx.cs" Inherits="ClientExportManager.ApplicationScenarios.PivotGrid.DefaultCS"Language="c#"  %>

<%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
     <!-- Load Pako ZLIB library to enable PDF compression -->
    <script src="../../../Common/Scripts/pako.min.js"></script>
    <style type="text/css">
        .kendo-pdf-hide-pseudo-elements:after,
        .kendo-pdf-hide-pseudo-elements:before {
            display: none !important;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <div class="demo-container">
        <telerik:RadButton RenderMode="Lightweight" runat="server" OnClientClicked="exportRadPivotGrid" Text="Export RadPivotGrid to PDF" AutoPostBack="false" UseSubmitBehavior="false"></telerik:RadButton>
        <br />
        <br />
        <telerik:RadClientExportManager runat="server" ID="RadClientExportManager1">
        </telerik:RadClientExportManager>
        <telerik:RadPivotGrid RenderMode="Lightweight" runat="server" ID="RadPivotGrid1" AllowPaging="true" PageSize="5"
            OnNeedDataSource="RadPivotGrid1_NeedDataSource" Width="100%" AllowSorting="true"
            AllowFiltering="false" ShowFilterHeaderZone="false">
            <PagerStyle Mode="Slider" AlwaysVisible="true"></PagerStyle>
            <Fields>
                <telerik:PivotGridColumnField DataField="Year" Caption="Year" UniqueName="Discount">
                </telerik:PivotGridColumnField>
                <telerik:PivotGridColumnField DataField="Quarter" Caption="Quarter" DataFormatString="Quarter {0}" UniqueName="UnitPrice">
                </telerik:PivotGridColumnField>
                <telerik:PivotGridAggregateField DataField="Quantity" Caption="Quantity" UniqueName="Quantity"
                    Aggregate="Average" DataFormatString="{0:F2}">
                </telerik:PivotGridAggregateField>
                <telerik:PivotGridRowField DataField="ProductName" Caption="ProductName" UniqueName="ProductName">
                </telerik:PivotGridRowField>
                <telerik:PivotGridRowField IsHidden="true" DataField="TotalPrice" Caption="OrderID"
                    UniqueName="OrderID" DataFormatString="{0:F2}">
                </telerik:PivotGridRowField>
            </Fields>
        </telerik:RadPivotGrid>
    </div>
    <script>
        var $ = $telerik.$;

        function exportRadPivotGrid() {
            $find('<%=RadClientExportManager1.ClientID%>').exportPDF($(".RadPivotGrid"));
        }

    </script>
    </form>
</body>
</html>

Support & Learning Resources

Find Assistance