print

prints a view according to the specified settings

void print(object| id view, [object options] );

Parameters

viewobject| idthe object or id of the view to print
optionsobjecta set of printing options, see the list below

Example

//view obj or view id
webix.print($$("datatable1")); 
webix.print("datatable1");
 
//with options
webix.print($$("datatable1"), {mode:"landscape"});

Related samples

Details

Common printing options

(for all widgets)

  • paper - (string) paper size. Possible values are "a3", "a4" (default), "letter"
  • mode - (string) page orientation. Possible values are "portrait" (default), "landscape"
  • margin - (number|object) margin for printed pages, can be of two types:
    • number - to set the same margin from all sides
    • object - with any of the properties: top, right, bottom, left containing number to set margins separately
  • docHeader - (string) document header on the first page before the printed view (independent of the browser print header)
  • docFooter - (string) document footer on the last page after the printed view (independent of the browser print header)

There are also additional properties that vary depending on the component.

For data components

  • scroll - (boolean) if true, prints only a visible part of a scrolled component. False by default.

For datatable, dataview, spreadsheet, X-list

  • fit - (string) adjusts printed component either to the page width ("page", default), or to the component width ("data").

For datatable and spreadsheet

  • header - (boolean) renders header for datatable, if exists
    • true (default for datatable)
    • false (default for spreadsheet)
  • skiprows - (boolean) skips empty rows within the datatable. False by default
  • borderless - (boolean) removes borders for datatable cells. False by default
  • trim - (boolean) removes empty rows and columns on the edges of datatable.
    • true (default for spreadsheet),
    • false (default for datatable)

For datatable only

  • footer - (boolean) renders footer for datatable, if exists. True by default

For spreadsheet only

  • data - (string) defines which data to print
    • "all" - all data from all sheets
    • "current" - all data from the current sheet (default)
    • "selection" - selected data from the current sheet
  • sheetnames - (boolean) renders name of sheets for each table. True by default.
See also
Back to top