-
Notifications
You must be signed in to change notification settings - Fork 0
Premium plugin : Print
Guillaume Bonnaire edited this page Aug 19, 2022
·
8 revisions
You can buy this plugin on Repo plugin Print Demo is available on demo Print
Option name | Description | Type | Default Value |
---|---|---|---|
allowPrint |
Allow print for page | Boolean |
true |
allowShortcut |
Allow shortcut CTRL+P for open popup of print | Boolean |
true |
autoprint |
start print automaticaly after preview. Set false for force preview before print | Boolean |
true |
header |
Show columns header on print | Boolean |
true |
index |
Show rows index on print | Boolean |
true |
orientation |
Defined orientation of page
|
String |
auto |
range |
Defined area range | ArrayOfCoord[x1,y1,x2,y2] or String "A1:B5" |
null |
rowBreaker |
Defined page breaker after number of rows | Int|"auto" |
"auto" |
style |
Defined styles CSS | String|Function |
(blank) |
stylesheet |
Defined url of style file .css | String |
(blank) |
title |
Title of page printed | String |
(blank) |
zoom |
Zoom of page printed (1 = 100%) | Float |
1 |
Option name | Default Value |
---|---|
text_true |
Yes |
text_false |
No |
text_orientation |
Orientation |
text_orientation_landscape |
Landscape |
text_orientation_portrait |
Portrait |
text_orientation_auto |
Printer settings |
text_zoom |
Zoom |
text_title |
Title of page |
text_popup_title |
Print options |
text_index |
Show index of rows |
text_header |
Show header of columns |
text_print_area |
Print area |
text_print_selection |
Print selection |
text_print_resultsearch |
Print results of search |
text_print_all |
Print all rows of the sheet |
text_print_area_defined |
Print area defined |
text_print |
|
text_printpreview |
Preview |
Method | Description | Example |
---|---|---|
do(*optional* Object optionsPrint) → Void |
execute print with options, if optionsPrint is null, print with default options | jspreadsheet.current.plugins.print.do({title:'test button print', index:false}); |
open() → Void |
Open popup print | jspreadsheet.current.plugins.print.open(); |
preview(*optional* Object optionsPrint) → Void |
execute preview print with options, if optionsPrint is null, preview with default options | jspreadsheet.current.plugins.print.preview({title:'test button print', index:false}); |
resetRange() → Void |
remove range print area | jspreadsheet.current.plugins.print.resetRange(); |
setRange(Array|String range) → Void |
set range print area (by Coord [x1,y1,x2,y2] of A1:B10) | jspreadsheet.current.plugins.print.setRange("A1:B10"); |
setStyle(String style) → Void |
set style of page printed | jspreadsheet.current.plugins.print.setStyle(".jexcel tbody tr td.cellAlert {background-color: #f46e42!important;color: #ffffff;}"); |
Event | Description | Arguments |
---|---|---|
onprint |
event dispatch after start print and preview | onprint(ElementJExcel) |
Header on page
<script src="https://jsuites.net/v4/jsuites.js"></script>
<script src="http://www.jspreadsheet.com/v9/jspreadsheet.js"></script>
<link rel="stylesheet" href="https://jsuites.net/v4/jsuites.css" type="text/css" />
<link rel="stylesheet" href="http://www.jspreadsheet.com/v9/jspreadsheet.css" type="text/css" />
<script src="/path/to/jss.print.js"></script>
Initialize plugin on JSpreadsheet
jspreadsheet(document.getElementById('spreadsheet'), {
...
plugins: [
...
{ name:'print', plugin:jss_print},
...
],
...
});
Header on page
<script src="https://jsuites.net/v4/jsuites.js"></script>
<script src="http://www.jspreadsheet.com/v9/jspreadsheet.js"></script>
<link rel="stylesheet" href="https://jsuites.net/v4/jsuites.css" type="text/css" />
<link rel="stylesheet" href="http://www.jspreadsheet.com/v9/jspreadsheet.css" type="text/css" />
<script src="/path/to/jexcel.print.js"></script>
Initialize plugin on JExcel
jspreadsheet(document.getElementById('spreadsheet'), {
...
plugins: [
...
{ name:'print', plugin:jss_print, options:{title:"test print", index:false, style:function(obj) { return obj.plugins.conditionalstyle.getCSS(); }} }, // For apply style of plugin conditional style
...
],
...
});
Copyright GBonnaire.fr and Code released under the commercial License. This plugin requiere license of Repo.gbonnaire.fr
All librairies available on https://repo.gbonnaire.fr