Issue with printing datagrid - Skiprows not working properly

Here is a snippet of the printing code: webix.print(webix.$$(args.id), {fit: "data", mode: "landscape", skiprows: true} );

When I set skiprows to true, I encounter an error (picture below). Removing the fit setting prevents the error, but the skiprows function still doesn’t work as nothing happens.

In my datagrid, I have filters in the header that I don’t want to be printed. However, the printer includes a column for them regardless of whether they are empty.

So to clarify:

  • An error occurs when both fit and skiprows are enabled.
  • skiprows alone doesn’t function as expected.

UPDATE:
This error only appears in some data grids. It seems to be working in another grid but for some reason it won’t work with all of them. Possibly the width of the grid? It’s working on a grid with smaller rows. It doesn’t seem to be the “fit” setting that is the issue.

Hello @simon_boijer,

Thank you for such a detailed report! Could you provide us a snippet with problematic datagrid in our snippet tool? This helps us to give a more accurate solution. Thank you in advance! :slight_smile:

Hello, it’s a bit difficult to recreate the issue in the editor, but I have pasted the object containing the data below.

I’ve also noticed a few additional things:

  • I can print with skiprows = False.
  • The problem seems to be related to the “length” columns. When I hide these columns, it works. The columns only contain zeros (at least most of them), and when I print, these columns appear empty (even though they should contain ‘0’).

https://snippet.webix.com/9ufllivp

The bug repeats when trying to export cells with zeros if the skiprows setting is present.
You need to add a template to the configuration of all columns where there may be zeros to display them as lines (this is how they will be printed):
template: (obj, type, value) => value === 0 ? value + "" : value,
Please, check out the snippet: Code Snippet