|
<html>
<head>
//...
<script src="Scripts/ejspreadsheet-custom-print-extension.js" type="text/javascript"></script>
<script type="text/javascript">
var defaultData, defaultData1;
defaultData = [...];
defaultData1 = [...];
$(function () {
$("#Spreadsheet").ejSpreadsheet({
sheets: [{
rangeSettings: [{ dataSource: defaultData }, { dataSource: defaultData1, startCell: "J1" }]
}],
loadComplete: "loadComplete"
});
});
function loadComplete(args) {
//Here extend the ejSpreadsheet.Extension
$.extend(this, ej.spreadsheetFeatures.extension);
if (!this.isImport) {
//...
this.XLChart.createChart("A1:B6", { type: "column", enable3D: false, marker: false, top: 40, left: 260, width: 340, height: 250 });
this.XLChart.createChart("J1:L6", { type: "column", enable3D: false, marker: false, top: 40, left: 860, width: 340, height: 250 });
}
}
function customPrintFunc() {
var ssObj = $("#Spreadsheet").data("ejSpreadsheet");
//If the passed cell range contains chart means, it'll automatically print after cell data or else print only cell data.
ssObj.customPrintSelection(["A1:C10", "J1:L6", "A10:C13"]); //Here pass the cells ranges that you want to print.
}
</script>
</head>
<body>
//...
<button onclick="customPrintFunc()">Click here to Print</button>
<div id="Spreadsheet"></div>
</body>
</html>
|