New to Kendo UI for jQueryStart a free 30-day trial

Pdf

configuration

Configures the Kendo UI PivotGrid PDF export settings.

pdf

Object
<div id="pivotgrid"></div>
<script>
$("#pivotgrid").kendoPivotGrid({
    pdf: {
        fileName: "PivotGrid.pdf",
        author: "Telerik",
        autoPrint: true,
        avoidLinks: true
    },
    height: 550,
    dataSource: {
        type: "xmla",
        columns: [{ name: "[Date].[Calendar]", expand: true }, { name: "[Product].[Category]" } ],
        rows: [{ name: "[Geography].[City]" }],
        measures: [
            { name: "[Measures].[Internet Revenue Status]", type: "status" }, //KPI Status measure that will render kpiStatusTemplate
            { name: "[Measures].[Internet Revenue Trend]", type: "trend" } //KPI Trend measure that will render kpiTrendTemplate
        ],
        transport: {
            connection: {
                catalog: "Adventure Works DW 2008R2",
                cube: "Adventure Works"
            },
            read: "https://demos.telerik.com/service/v2/olap/msmdpump.dll"
        },
        schema: {
            type: "xmla"
        },
        error: function (e) {
            console.log("error: " + kendo.stringify(e.errors[0]));
        }
    }
});
</script>

The author of the PDF document.

Default: null

<div id="pivotgrid"></div>
<script>
$("#pivotgrid").kendoPivotGrid({
    pdf: {
        author: "John Doe"
    },
    height: 550,
    dataSource: {
        type: "xmla",
        columns: [{ name: "[Date].[Calendar]", expand: true }, { name: "[Geography].[City]" } ],
        rows: [{ name: "[Product].[Product]" }],
        measures: ["[Measures].[Internet Sales Amount]"],
        transport: {
            connection: {
                catalog: "Adventure Works DW 2008R2",
                cube: "Adventure Works"
            },
            read: {
                url: "https://demos.telerik.com/service/v2/olap/msmdpump.dll",
                dataType: "text",
                contentType: "text/xml",
                type: "POST"
            }
        },
        schema: {
            type: "xmla"
        }
    }
});
</script>

Specifies if the Print dialog should be opened immediately after loading the document.

Note: Some PDF Readers/Viewers will not allow opening the Print Preview by default, it might be necessary to configure the corresponding add-on or application.

Default: false

<div id="pivotgrid"></div>
<script>
$("#pivotgrid").kendoPivotGrid({
    pdf: {
        autoPrint: true
    },
    height: 550,
    dataSource: {
        type: "xmla",
        columns: [{ name: "[Date].[Calendar]", expand: true }, { name: "[Geography].[City]" } ],
        rows: [{ name: "[Product].[Category]", expand: true }],
        measures: ["[Measures].[Internet Sales Amount]"],
        transport: {
            connection: {
                catalog: "Adventure Works DW 2008R2",
                cube: "Adventure Works"
            },
            read: {
                url: "https://demos.telerik.com/service/v2/olap/msmdpump.dll",
                dataType: "text",
                contentType: "text/xml",
                type: "POST"
            }
        },
        schema: {
            type: "xmla"
        }
    }
});
</script>
Boolean|String

A flag indicating whether to produce actual hyperlinks in the exported PDF file.

It's also possible to pass a CSS selector as argument. All matching links will be ignored.

Available in versions 2015.3.1020 and later

Default: false

<div id="pivotgrid"></div>
<script>
$("#pivotgrid").kendoPivotGrid({
    pdf: {
        avoidLinks: true
    },
    height: 550,
    dataSource: {
        type: "xmla",
        columns: [{ name: "[Date].[Calendar]", expand: true }, { name: "[Geography].[City]" } ],
        rows: [{ name: "[Product].[Category]", expand: true }],
        measures: ["[Measures].[Internet Sales Amount]"],
        transport: {
            connection: {
                catalog: "Adventure Works DW 2008R2",
                cube: "Adventure Works"
            },
            read: {
                url: "https://demos.telerik.com/service/v2/olap/msmdpump.dll",
                dataType: "text",
                contentType: "text/xml",
                type: "POST"
            }
        },
        schema: {
            type: "xmla"
        }
    }
});
</script>

The creator of the PDF document.

Default: "Kendo UI PDF Generator"

<div id="pivotgrid"></div>
<script>
$("#pivotgrid").kendoPivotGrid({
    pdf: {
        creator: "John Doe"
    },
    height: 550,
    dataSource: {
        type: "xmla",
        columns: [{ name: "[Date].[Calendar]", expand: true }, { name: "[Geography].[City]" } ],
        rows: [{ name: "[Product].[Product]" }],
        measures: ["[Measures].[Internet Sales Amount]"],
        transport: {
            connection: {
                catalog: "Adventure Works DW 2008R2",
                cube: "Adventure Works"
            },
            read: {
                url: "https://demos.telerik.com/service/v2/olap/msmdpump.dll",
                dataType: "text",
                contentType: "text/xml",
                type: "POST"
            }
        },
        schema: {
            type: "xmla"
        }
    }
});
</script>

The date when the PDF document is created. Defaults to new Date().

<div id="pivotgrid"></div>
<script>
$("#pivotgrid").kendoPivotGrid({
    pdf: {
        date: new Date("2014/10/10")
    },
    height: 550,
    dataSource: {
        type: "xmla",
        columns: [{ name: "[Date].[Calendar]", expand: true }, { name: "[Geography].[City]" } ],
        rows: [{ name: "[Product].[Product]" }],
        measures: ["[Measures].[Internet Sales Amount]"],
        transport: {
            connection: {
                catalog: "Adventure Works DW 2008R2",
                cube: "Adventure Works"
            },
            read: {
                url: "https://demos.telerik.com/service/v2/olap/msmdpump.dll",
                dataType: "text",
                contentType: "text/xml",
                type: "POST"
            }
        },
        schema: {
            type: "xmla"
        }
    }
});
</script>

Specifies the file name of the exported PDF file.

Default: "Export.pdf"

<div id="pivotgrid"></div>
<script>
$("#pivotgrid").kendoPivotGrid({
    pdf: {
        fileName: "Products.pdf"
    },
    height: 550,
    dataSource: {
        type: "xmla",
        columns: [{ name: "[Date].[Calendar]", expand: true }, { name: "[Geography].[City]" } ],
        rows: [{ name: "[Product].[Product]" }],
        measures: ["[Measures].[Internet Sales Amount]"],
        transport: {
            connection: {
                catalog: "Adventure Works DW 2008R2",
                cube: "Adventure Works"
            },
            read: {
                url: "https://demos.telerik.com/service/v2/olap/msmdpump.dll",
                dataType: "text",
                contentType: "text/xml",
                type: "POST"
            }
        },
        schema: {
            type: "xmla"
        }
    }
});
</script>

If set to true, the content will be forwarded to proxyURL even if the browser supports saving files locally.

Default: false

<div id="pivotgrid"></div>
<script>
$("#pivotgrid").kendoPivotGrid({
    pdf: {
        forceProxy: true,
        proxyURL: "/save"
        //configure a valid endpoint which will export the file 
    },
    height: 550,
    dataSource: {
        type: "xmla",
        columns: [{ name: "[Date].[Calendar]", expand: true }, { name: "[Geography].[City]" } ],
        rows: [{ name: "[Product].[Product]" }],
        measures: ["[Measures].[Internet Sales Amount]"],
        transport: {
            connection: {
                catalog: "Adventure Works DW 2008R2",
                cube: "Adventure Works"
            },
            read: {
                url: "https://demos.telerik.com/service/v2/olap/msmdpump.dll",
                dataType: "text",
                contentType: "text/xml",
                type: "POST"
            }
        },
        schema: {
            type: "xmla"
        }
    }
});
</script>

Specifies the quality of the images within the exported file, from 0 to 1.

Default: 0.92

<div id="pivotgrid"></div>
<script>
$("#pivotgrid").kendoPivotGrid({
    pdf: {
        jpegQuality: 0.8
    },
    height: 580,
    dataSource: {
        type: "xmla",
        columns: [{ name: "[Date].[Calendar]", expand: true }, { name: "[Product].[Category]" } ],
        rows: [{ name: "[Geography].[City]" }],
        measures: [
            { name: "[Measures].[Internet Revenue Status]", type: "status" }, //KPI Status measure that will render kpiStatusTemplate
            { name: "[Measures].[Internet Revenue Trend]", type: "trend" } //KPI Trend measure that will render kpiTrendTemplate
        ],
        transport: {
            connection: {
                catalog: "Adventure Works DW 2008R2",
                cube: "Adventure Works"
            },
            read: "https://demos.telerik.com/service/v2/olap/msmdpump.dll"
        },
        schema: {
            type: "xmla"
        },
        error: function (e) {
            console.log("error: " + kendo.stringify(e.errors[0]));
        }
    }
});
</script>

If set to true all PNG images contained in the exported file will be kept in PNG format.

Default: false

<div id="pivotgrid"></div>
<script>
$("#pivotgrid").kendoPivotGrid({
    pdf: {
        keepPNG: true
    },
    height: 550,
    dataSource: {
        type: "xmla",
        columns: [{ name: "[Date].[Calendar]", expand: true }, { name: "[Product].[Category]" } ],
        rows: [{ name: "[Geography].[City]" }],
        measures: [
            { name: "[Measures].[Internet Revenue Status]", type: "status" }, //KPI Status measure that will render kpiStatusTemplate
            { name: "[Measures].[Internet Revenue Trend]", type: "trend" } //KPI Trend measure that will render kpiTrendTemplate
        ],
        transport: {
            connection: {
                catalog: "Adventure Works DW 2008R2",
                cube: "Adventure Works"
            },
            read: "https://demos.telerik.com/service/v2/olap/msmdpump.dll"
        },
        schema: {
            type: "xmla"
        },
        error: function (e) {
            console.log("error: " + kendo.stringify(e.errors[0]));
        }
    }
});
</script>

Specifies the keywords of the exported PDF file.

Default: null

<div id="pivotgrid"></div>
<script>
$("#pivotgrid").kendoPivotGrid({
    pdf: {
        keywords: "northwind products"
    },
    height: 550,
    dataSource: {
        type: "xmla",
        columns: [{ name: "[Date].[Calendar]", expand: true }, { name: "[Geography].[City]" } ],
        rows: [{ name: "[Product].[Product]" }],
        measures: ["[Measures].[Internet Sales Amount]"],
        transport: {
            connection: {
                catalog: "Adventure Works DW 2008R2",
                cube: "Adventure Works"
            },
            read: {
                url: "https://demos.telerik.com/service/v2/olap/msmdpump.dll",
                dataType: "text",
                contentType: "text/xml",
                type: "POST"
            }
        },
        schema: {
            type: "xmla"
        }
    }
});
</script>

Set to true to reverse the paper dimensions if needed such that width is the larger edge.

Default: false

<div id="pivotgrid"></div>
<script>
$("#pivotgrid").kendoPivotGrid({
    pdf: {
        landscape: true
    },
    height: 550,
    dataSource: {
        type: "xmla",
        columns: [{ name: "[Date].[Calendar]", expand: true }, { name: "[Geography].[City]" } ],
        rows: [{ name: "[Product].[Product]" }],
        measures: ["[Measures].[Internet Sales Amount]"],
        transport: {
            connection: {
                catalog: "Adventure Works DW 2008R2",
                cube: "Adventure Works"
            },
            read: {
                url: "https://demos.telerik.com/service/v2/olap/msmdpump.dll",
                dataType: "text",
                contentType: "text/xml",
                type: "POST"
            }
        },
        schema: {
            type: "xmla"
        }
    }
});
</script>

Specifies the margins of the page (numbers or strings with units). Supported units are "mm", "cm", "in" and "pt" (default).

<div id="pivotgrid"></div>
<script>
$("#pivotgrid").kendoPivotGrid({
    pdf: {
        margin: {
            left: 10,
            right: "10pt",
            top: "10mm",
            bottom: "1in"
        }
    },
    height: 550,
    dataSource: {
        type: "xmla",
        columns: [{ name: "[Date].[Calendar]", expand: true }, { name: "[Geography].[City]" } ],
        rows: [{ name: "[Product].[Product]" }],
        measures: ["[Measures].[Internet Sales Amount]"],
        transport: {
            connection: {
                catalog: "Adventure Works DW 2008R2",
                cube: "Adventure Works"
            },
            read: {
                url: "https://demos.telerik.com/service/v2/olap/msmdpump.dll",
                dataType: "text",
                contentType: "text/xml",
                type: "POST"
            }
        },
        schema: {
            type: "xmla"
        }
    }
});
</script>

pdf.paperSize

String|Array

Specifies the paper size of the PDF document. The default "auto" means paper size is determined by content.

The size of the content in pixels will match the size of the output in points (1 pixel = 1/72 inch).

Supported values:

  • A predefined size: "A4", "A3" etc
  • An array of two numbers specifying the width and height in points (1pt = 1/72in)
  • An array of two strings specifying the width and height in units. Supported units are "mm", "cm", "in" and "pt".

Default: "auto"

<div id="pivotgrid"></div>
<script>
$("#pivotgrid").kendoPivotGrid({
    pdf: {
        paperSize: ["20mm", "20mm"]
    },
    height: 550,
    dataSource: {
        type: "xmla",
        columns: [{ name: "[Date].[Calendar]", expand: true }, { name: "[Geography].[City]" } ],
        rows: [{ name: "[Product].[Product]" }],
        measures: ["[Measures].[Internet Sales Amount]"],
        transport: {
            connection: {
                catalog: "Adventure Works DW 2008R2",
                cube: "Adventure Works"
            },
            read: {
                url: "https://demos.telerik.com/service/v2/olap/msmdpump.dll",
                dataType: "text",
                contentType: "text/xml",
                type: "POST"
            }
        },
        schema: {
            type: "xmla"
        }
    }
});
</script>

A name or keyword indicating where to display the document returned from the proxy.

If you want to display the document in a new window or iframe, the proxy should set the "Content-Disposition" header to inline; filename="<fileName.pdf>".

Default: "_self"

<div id="pivotgrid"></div>
<script>
$("#pivotgrid").kendoPivotGrid({
    pdf: {
        forceProxy: true,
        proxyURL: "/save",
        proxyTarget: "_blank"
    },
    height: 550,
    dataSource: {
        type: "xmla",
        columns: [{ name: "[Date].[Calendar]", expand: true }, { name: "[Geography].[City]" } ],
        rows: [{ name: "[Product].[Product]" }],
        measures: ["[Measures].[Internet Sales Amount]"],
        transport: {
            connection: {
                catalog: "Adventure Works DW 2008R2",
                cube: "Adventure Works"
            },
            read: {
                url: "https://demos.telerik.com/service/v2/olap/msmdpump.dll",
                dataType: "text",
                contentType: "text/xml",
                type: "POST"
            }
        },
        schema: {
            type: "xmla"
        }
    }
});
</script>

The URL of the server side proxy which will stream the file to the end user.

A proxy will be used when the browser is not capable of saving files locally, for example, Internet Explorer 9 and Safari.

The developer is responsible for implementing the server-side proxy.

The proxy will receive a POST request with the following parameters in the request body:

  • contentType: The MIME type of the file
  • base64: The base-64 encoded file content
  • fileName: The file name, as requested by the caller.

The proxy should return the decoded file with the "Content-Disposition" header set to attachment; filename="<fileName.pdf>".

Default: null

<div id="pivotgrid"></div>
<script>
$("#pivotgrid").kendoPivotGrid({
    pdf: {
        proxyURL: "/save"
    },
    height: 550,
    dataSource: {
        type: "xmla",
        columns: [{ name: "[Date].[Calendar]", expand: true }, { name: "[Geography].[City]" } ],
        rows: [{ name: "[Product].[Product]" }],
        measures: ["[Measures].[Internet Sales Amount]"],
        transport: {
            connection: {
                catalog: "Adventure Works DW 2008R2",
                cube: "Adventure Works"
            },
            read: {
                url: "https://demos.telerik.com/service/v2/olap/msmdpump.dll",
                dataType: "text",
                contentType: "text/xml",
                type: "POST"
            }
        },
        schema: {
            type: "xmla"
        }
    }
});
</script>

Sets the subject of the PDF file.

Default: null

<div id="pivotgrid"></div>
<script>
$("#pivotgrid").kendoPivotGrid({
    pdf: {
        subject: "Products"
    },
    height: 550,
    dataSource: {
        type: "xmla",
        columns: [{ name: "[Date].[Calendar]", expand: true }, { name: "[Geography].[City]" } ],
        rows: [{ name: "[Product].[Product]" }],
        measures: ["[Measures].[Internet Sales Amount]"],
        transport: {
            connection: {
                catalog: "Adventure Works DW 2008R2",
                cube: "Adventure Works"
            },
            read: {
                url: "https://demos.telerik.com/service/v2/olap/msmdpump.dll",
                dataType: "text",
                contentType: "text/xml",
                type: "POST"
            }
        },
        schema: {
            type: "xmla"
        }
    }
});
</script>

pdf.title

String

Sets the title of the PDF file.

Default: null

<div id="pivotgrid"></div>
<script>
$("#pivotgrid").kendoPivotGrid({
    pdf: {
        title: "Internet Sales Amount"
    },
    height: 550,
    dataSource: {
        type: "xmla",
        columns: [{ name: "[Date].[Calendar]", expand: true }, { name: "[Geography].[City]" } ],
        rows: [{ name: "[Product].[Product]" }],
        measures: ["[Measures].[Internet Sales Amount]"],
        transport: {
            connection: {
                catalog: "Adventure Works DW 2008R2",
                cube: "Adventure Works"
            },
            read: {
                url: "https://demos.telerik.com/service/v2/olap/msmdpump.dll",
                dataType: "text",
                contentType: "text/xml",
                type: "POST"
            }
        },
        schema: {
            type: "xmla"
        }
    }
});
</script>