PivotGrid - Export to PDF



QuantityYearQuarter
ProductName
19971997 Total 19981998 TotalGrand Total
Quarter 1Quarter 2Quarter 3Quarter 4Quarter 1Quarter 2Quarter 3Quarter 4
36.0028.5716.5060.0029.2812.0041.6713.259.0019.7325.66
20.0055.006.0018.0027.1425.0027.67  27.0027.09
22.7525.6724.0022.4423.8418.3338.3351.5015.0030.3025.69
25.1738.3317.0035.7131.6721.7531.60100.0022.0028.5330.18
22.83 15.0028.7523.5017.6718.3325.006.0015.1019.68
23.1425.0324.7023.3724.0726.0020.7925.5322.8423.5123.85
Alice Mutton
Aniseed Syrup
Boston Crab Meat
Camembert Pierrot
Carnarvon Tigers
Grand Total
Page 1 of 16
Isolate this demo as a stand-alone application
  • About this demo
  • C#
  • VB

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.

  • DefaultVB.aspx
  • DefaultVB.aspx.vb
<%@ Page AutoEventWireup="false" CodeFile="DefaultVB.aspx.vb" Inherits="ClientExportManager.ApplicationScenarios.PivotGrid.DefaultVB"Language="vb"  %>

<%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<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>

Find Assistance

Help Us Improve

Was this example helpful?