☝️Small business or a startup? See if you qualify for our special offer.
+
All documentation

print

print(options: Object)

Prints the current view via the OS print manager. If the current view is the drill-through view, the grid or chart view will be printed instead.

To learn more about printing, see this guide: Print the report.

Parameters

Parameter/TypeDescription
options
Object
optional Contains printing options.
options.header
String | HTML string
optional String that will be displayed in the header section of the printed PDF file. You can set the options.header as a regular string or an HTML string with tags, inline styles, and Base64 images. The string is rendered in the browser and added as an image to the printed PDF file.
When setting the header, you can use the following tokens in the string:
  • ##CURRENT-DATE## — displays the date when the printed PDF file was created.
  • ##PAGE-NUMBER## — displays the page numbers in the printed PDF file starting from 1.
options.footer
String | HTML string
optional String that will be displayed in the footer section of the printed PDF file. You can set the options.footer as a regular string or an HTML string with tags, inline styles, and Base64 images. The string is rendered in the browser and added as an image to the printed PDF file.
When setting the footer, you can use the following tokens in the string:
  • ##CURRENT-DATE## — displays the date when the printed PDF file was created.
  • ##PAGE-NUMBER## — displays the page numbers in the printed PDF file starting from 1.

Examples

1) Print the content:

pivot.print();

Try the example on JSFiddle.

2) Add header and footer:

const options = {
header:"<div>##CURRENT-DATE##</div>",
footer:"<div>##PAGE-NUMBER##</div>"
}
pivot.print(options);

Open the example on JSFiddle.

See also

Print tutorial
printcomplete
printstart