Few printing (basic reporting) stuff request/remarks

Hi !

I have few question regarding how I can print/produce some report (coming from seatable where there is a specific module for this, but globaly python + widget seems much more powerfull + hability to self host).

I’m trying to avoid custom widget as I do not want to dive in deep codes (though Vuejs is very nice)

So :

  • When printing a widget the color disappears (same issue on seatable)
  • I find no way to print a global page (document + all the widgets)
  • Already asked but a kind of customization (font, size) of the card label would help a lot
  • Suppose you have a doc with a card + other linked widget, is there a way to print all the card and their associated widget, each generated card+widget in a separate page ?
  • Being able to mail the above result would be also nice :slight_smile:

Thanks for your great work !

1 Like

Hi Sylvain, sorry no good answers here, just collecting what I found:

  • Disappearing color is due to using the bootstrap CSS library that Grist uses. It’s too opinionated, including on overriding all backgrounds for all elements. It’s hard not to use it because some components rely on it, but maybe it’s possible to use a reduced version…
  • If you just use the browser’s standard “Print page” function, you should get a printable version of the screen (with no toolbars, but all the widgets). Are you hoping for something different?
  • Allowing to customizing card label font is a reasonable feature request.
  • Do you mean the kind of Card view where you step through cards (like here Time-Sheets)? Or when printing a Card List, to print each card on its own page? Or when a Card is linked to a list (like here Lightweight CRM), to print each card on its own page? It feels like the different scenarios might involve different options.
  • Most browsers will let you print to PDF, or save as PDF from the print dialog, so that should be possible at least!

Hello Dmitry,

Thanks for you answer.

  • Color : I will deal with Screenshot for the moment as this is something quite important for me
  • I’ve tried the Print Page but considering the lost of layout + color I will revert to screenshot. Since I’m dealing for the moment to 17 cards to be printed and sent twice a year, this is not a big job.
  • Thanks for the font, it will help to produce nicer basic-reports
  • Cards Printing → Yes like Times Sheets : I want to print the “screen” for each card (each card having a table-widget linked to the card)

=> For all of this the solution will be to iterate through the cards and take Screenshot. I have then to share them (something more or less similar to the screenshot above).

Anyway grist is one of the best & productive & innovating tool I’ve seen.
Congratulations !

2 Likes

I agree, printing colors to PDF or printer, would be very important.

1 Like

Hello,

Just For Information, I am now heavily using custom widget with
https://gristlabs.github.io/grist-widget/renderhtml

it enables me to render logic, colors etc…
As being self-hosted (electron) I have installed jinja2

you can also use @stan-donarise specific widget GitHub - stan-donarise/grist-docxtemplater-widget: Grist custom widget that generates docx from templates
Although you cannot add logic in the template (and thus add specific color) it may helps you (label printing, …)

What’s the difference from the “Render HTML” widget above to the HTML Viewer standard custom widget?

It shows a single field at a time anyway, so I am not sure how I would use it to display multiple records with multiple fields.

As for the “generate docx” I can´t even use it. Pasting your link URL or the index.html file URL in the Custom Widget says “connection with Github refused”

“Render HTML” custom widget is the same as HTML Viewer in grist online
have a look there :

for docstemplater, have a look on stan log :
Generate docx from template - Custom Widget

Hope it helps

I still haven´t been able to use the custom docstemplater widget… haven´t found any info on Stan’s Log on how to use it.

it reads “sorry, connection with Github was refused”

I tried pasting this URL in the Custom Widget

as for th RenderHTML Widget, I am not sure how you use it, since it only shows a single field from a single record.

For Html render widget you have to return a string containing the html stuff.
Have a look below.
You need to manipulate python + (html-CSS) but can give nice results

Then using print widget + print background color you have the colors… :neutral_face:
That’s only work around I have found

For docx the idea is more or less similar I have not enough time here but check carrefully the exaples provoided

I checked the examples, but I still dont get how to use it. The example don´t give edit access so all fields are grayed out and can´t be copied. So I can´t copy the link to the widget.

The DocGenerator actually seems to be a paid program (and quite expensive btw). Are you sure Stan made it available as a free widget for Grist?

I made a new version of the docxtemplater widget that should work (and offers some more options), see here. Hope it helps someone!

1 Like

Hello @TomNit ,

Seems to be quite nice !
Is there any chance to render some picture stored in Grist ?

I have tried this docxtemplater - Grist, but it returns only text link (as expected …)

Or if I put {%image} as described in the doc it results as fail. I think the widget should handle the dowload of the image, I gave a look at : Image module | docxtemplater, but it’s far too complex for me to integrate with your module…

:slight_smile:

@Sylvain_Page that’s a good point, I actually didn’t test images. But it should definitely be doable. I’ve got some time today, so let me see what I can come up with… Actually, it turns out this is a paid pro feature of docxtemplater. So no, unfortunately it’s not possible within the scope of this project, sorry. You can always include static images as part of your template, of course - just not have them inserted dynamically.
Actually, I’m just posting too fast! :slight_smile: There is a free version of it here apparently: GitHub - pwndoc/docxtemplater-image-module-pwndoc: Open Source Image Module for docxtemplater. Stay tuned - I’ll look into this!

:+1: That would be nice!
Feeding the template with photos stored in the Grist database is a must for me. Also, relying on a more universal template system ensures that other people can dig in easily if necessary.

@Sylvain_Page, I’ve managed to get images working! :smiley:. See here Report printing using DOCX template - Custom widget (new version) - #2 by TomNit.