Page 1 of 1

[REACT] variable row height breaks printing

Posted: Sun Apr 27, 2025 12:00 pm
by kosmos1

Hello,

to reproduce these bug
use
https://bryntum.com/products/gantt/examples/print/

added fixedRowHeight: false,
and feature rowResize: {
disabled: false,
},

import { Gantt, ProjectModel, DateHelper } from '../../build/gantt.module.js?484833';
import shared from '../_shared/shared.module.js?484833';

const project = new ProjectModel({
    autoSetConstraints : true,
    autoLoad           : true,
    loadUrl            : '../_datasets/launch-saas.json',
    // This config enables response validation and dumping of found errors to the browser console.
    // It's meant to be used as a development stage helper only so please set it to false for production systems.
    validateResponse   : true
});

const headerTpl = ({ currentPage, totalPages }) => `
    <img alt="Company logo" src="resources/bryntum.svg"/>
    <dl>
        <dt>Date: ${DateHelper.format(new Date(), 'll LT')}</dt>
        <dd>${totalPages ? `Page: ${currentPage + 1}/${totalPages}` : ''}</dd>
    </dl>
    `;

const footerTpl = () => `<h3>© ${new Date().getFullYear()} Bryntum AB</h3></div>`;

const gantt = new Gantt({
    // We don't need to export demo header
    appendTo          : 'container',
    project,
    dependencyIdField : 'sequenceNumber',

columns : [
    { type : 'name', field : 'name', text : 'Name', width : 200 },
    { type : 'startdate', text : 'Start date' },
    { type : 'duration', text : 'Duration' }
],

columnLines : false,
fixedRowHeight: false,
features : {
    print : {
        headerTpl,
        footerTpl
    },
    rowResize: {
        disabled: false,
    },
},

tbar : [
    {
        type : 'button',
        ref  : 'printButton',
        icon : 'b-fa-print',
        text : 'Print',
        onClick() {
            gantt.features.print.showPrintDialog();
        }
    }
]
});

after that change first couple of rows height and press print

you will see something strange in print
one task will contain multiple bars

2025-04-27 12_56_56-Bryntum Gantt - Print demo.png
2025-04-27 12_56_56-Bryntum Gantt - Print demo.png (47 KiB) Viewed 165 times

but if you scroll to see all rows it will fix it.

video of the bug
https://youtu.be/OM8EqVzNwLA

how to fix these behavior before printing or is there some workaround?


Re: [REACT] variable row height breaks printing

Posted: Mon Apr 28, 2025 7:43 am
by alex.l

Hi,

Thank you for very clear steps to reproduce this problem, here is a ticket to fix that https://github.com/bryntum/support/issues/11247
You can subscribe on ticket updates to be notified when it's done.