We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Essential JS2

Syncfusion jQuery based widgets are no longer in active development. Switch to our pure JavaScript based next generation Essential JS 2 library.

Syncfusion Feedback

How to custom print the multiple cell range in Spreadsheet

Platform: jQuery |
Control: ejSpreadSheet


This knowledge base explains how to custom print the multiple cell range in Spreadsheet.


It can be achieved by using ‘customPrintSelection()’ extension method which is provided in the extension script (Custom-print-extension.min.js).




<script type="text/javascript" src="ej.web.all.min.js"></script>
<script src="Custom-print-extension.min.js" type="text/javascript"></script>
<input type="button" onclick="customPrintFunc()" value="Click here to Print" />
<div id="Spreadsheet"></div>




var defaultData = [{ "Name": "VINET", "Average": 90, "Grade": "S" }, { "Name": "TOMSP", "Average": 83, "Grade": "A" }, { "Name": "HANAR", "Average": 80, "Grade": "A" }, { "Name": "VICTE", "Average": 93, "Grade": "S" }];
    sheets: [{
        dataSource: defaultData
    loadComplete: "loadComplete"




    .Sheets(sheets =>
        <!-- you can define the datasource at server side -->
        events => events.LoadComplete("loadComplete")




<ej:Spreadsheet ID="Spreadsheet" runat="server">
        <ej:Sheet></ej:Sheet><!-- you can define datasource at server side -->
    <ClientSideEvents LoadComplete="loadComplete" />




function loadComplete(args) {
    //Here extend the ejSpreadsheet.Extension
    $.extend(this, ej.spreadsheetFeatures.extension);
    if (!this.isImport) {
        this.setWidthToColumns([{ colIndex: 0, width: 90 }, { colIndex: 1, width: 85 }, { colIndex: 2, width: 100 }, { colIndex: 11, width: 70 }]);
        this.XLChart.createChart("A1:B6", { type: "column", enable3D: false, marker: false, top: 40, left: 260, width: 340, height: 250 });
function customPrintFunc() {
    var ssObj = $("#Spreadsheet").data("ejSpreadsheet");
    //If passed the chart date range, it'll will print chart after its cell data
    ssObj.customPrintSelection(["A1:C10", "A10:C13"]); //Here pass the cells ranges that you want to print.



You can download the custom script ‘custom-print-extension.min.js’ from below link,




The following screenshot is displayed as the output of custom printing Spreadsheet with chart and its range data.


spreadsheet custom print sample preview

Figure:  Custom printing of Chart and its data range in Spreadsheet


You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile