mui-x icon indicating copy to clipboard operation
mui-x copied to clipboard

Problem when printing the table, not all rows are displayed.

Open TSchaefer78 opened this issue 2 years ago • 6 comments

Duplicates

  • [X] I have searched the existing issues

Latest version

  • [X] I have tested the latest version

Steps to reproduce 🕹

Link to live example:

Steps: 1. 2. 3.

Current behavior 😯

Hello,

I have a problem when printing the muidatagrid table. Not all rows of the table are displayed in the print preview. Often only part of the last line is missing.

I installed version 5.17.21.

This problem occurs in Microsoft Edge, Google Chrome browsers. Firefox shows all lines in the print preview without a border.

Please urgently for help.

Best regards Tom Shepherd

image

Expected behavior 🤔

all rows of the table should be printed out

Context 🔦

No response

Your environment 🌎

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Order ID or Support key 💳 (optional)

No response

TSchaefer78 avatar Jun 01 '23 11:06 TSchaefer78

Could you provide a CodeSandbox with a minimal reproduction? Are you using dynamic row height?

m4theushw avatar Jun 01 '23 22:06 m4theushw

Yes, I use the automatic line height.

Unfortunately, I can't provide a sandbox example.

<StyledDataGrid rows={maintenanceMachinesIntervals ? maintenanceMachinesIntervals : ''} columns={columns} sx={{ '@media print': { '.MuiDataGrid-main': { color: 'rgba(0, 0, 0, 0.87)' }, }, }} slots={{ }} slotProps={{ }} autoHeight={true} getRowHeight={() => 'auto'} getRowId={(rows) => rows.id} components={{Toolbar: CustomToolbar}} hideFooter={true} disableAddFilterButton disableColumnFilter style={{fontSize: "0.9rem"}} filterModel={filt} columnVisibilityModel={columnVisibilityModel} onColumnVisibilityModelChange={(newModel) => setColumnVisibilityModel(newModel) } componentsProps={{ row: { onClick: (e, params) => {handleTableRow(e, params)} }, cell: { /* onMouseEnter: (params, event) => {console.log(params.target.innerText)} / / onMouseEnter: (params, event) => {handleTableCell(params, event)} / onClick: (params, event) => {handleTableCell(params, event)} / onMouseLeave: handlePopperClose */ } }} />

TSchaefer78 avatar Jun 07 '23 10:06 TSchaefer78

I have the same issue. When using getRowHeight often some of the rows in the end are not displayed.

dashty94 avatar Dec 10 '23 08:12 dashty94

Same issue with this sample: https://next--material-ui-x.netlify.app/x/react-data-grid/export/#ExcelExportWithWebWorker Not all rows are printed

korpthidrandir avatar Mar 19 '24 14:03 korpthidrandir

I have the same issue. When using getRowHeight often some of the rows in the end are not displayed.

liminkai avatar May 16 '24 03:05 liminkai

I was facing the same issue fixed it by using these styles

    @media print {
        body {
          -webkit-print-color-adjust: exact !important;
          print-color-adjust: exact !important;
        }
        
        .MuiDataGrid-main,
        .MuiDataGrid-virtualScroller {
          overflow: visible !important;
          height: auto !important;
        }
      }

ayushjain6 avatar Oct 16 '24 14:10 ayushjain6