Skip to content

GridPrintExportOptions API

Extended documentation for the GridPrintExportOptions interface with detailed information on the module's properties and available APIs.

Demos

Import

import { GridPrintExportOptions } from '@mui/x-data-grid-premium'
// or
import { GridPrintExportOptions } from '@mui/x-data-grid-pro'
// or
import { GridPrintExportOptions } from '@mui/x-data-grid'


The options to apply on the Print export.

Properties

Optional

If true, the hidden columns will also be exported.

Type:boolean

Default:false


Optional

One or more classes passed to the print window.

Type:string


Optional

If false, all <style> and <link type="stylesheet" /> tags from the <head> will not be copied
to the print window.

Type:boolean

Default:true


Optional

The columns exported.
This should only be used if you want to restrict the columns exports.

Type:string[]


Optional

The value to be used as the print window title.

Type:string

Default:The title of the page.


Optional

Function that returns the list of row ids to export in the order they should be exported.

Type:(params: GridPrintGetRowsToExportParams) => GridRowId[]


Optional

If true, the footer is removed for when printing.

Type:boolean

Default:false


Optional

If true, the toolbar is removed for when printing.

Type:boolean

Default:false


Optional

If true, the selection checkboxes will be included when printing.

Type:boolean

Default:false


Optional

Callback function that is called when a stylesheet, or a stylesheet it imports, fails to load in the print window,
for example if a request fails or a Content Security Policy blocks it.
Return or resolve to false to cancel the export without an error.
Throw or reject to make the export fail with that error.
Return anything else to continue the export, so the result may be missing some styles.
If not provided, the export continues and the failure is logged as a warning in development.

Type:(element: HTMLLinkElement, reason: StylesheetErrorReason) => Promise<boolean | void> | boolean | void


Optional

Provide Print specific styles to the print window.

Type:string | (() => string)