Once you have your formula return valid HTML, you might use the HTML Viewer Widget to view it. Then, in the frame of the widget, right-click > “This frame” > “Print frame…” (I’m guessing the translations, because I’m French!). Example here.
Thanks, but the formula right now is creating HTML in the memory only I guess, as the it’s created with a button. I guess I need the button to write the HTML to another cell, then the HTML viewer to be linked to that cell?
Why bother with a button ? If you replace your “action cell” by an “html cell” whose formula returns the variable containing the HTML, the HTML Viewer doesn’t need a button.
In your code, you where defining a generate_html_report function that had an internal variable html_template, then returning an external variable html_template without calling the function itself: so it was technically empty, hence the blank report.
Either ChatGPT is not the threat to programmers that many thought it would be, or I am so dumb that I am giving the worst prompts ever, but most code it generates leads me to nowhere. I am trying now to append below the header with the training info, the employees selected to that training. The result rfom ChatGDP gets me an error code that Funcionarios (employees) is not defined.
For having tried it, ChatGPT is quite impressive to accelerate development, but it frequently leaves errors to be corrected. What’s impressive too is that, if you tell it which error it did, it will correct it.
As is, I’m guessing you have a Funcionarios column? Would you have a sample you could share on docs.getgrist.com? This would make it easier to investigate, especially if you share it with public editor access.
I edited your code after including more fields, etc.
Only thing I am failing is to make the table rows height smaller. Changed padding, height, etc, all fails. It’s like if the cells still had some hidden feature causing the space between them. Reducing the row height is specially important in the whole page header.
I also tried to change LINE HEIGHT, but then it also makes the space between two lines in the same row too small, so the lines get one above the other.
One problem is that most help I find on the web regarding HTML and even from ChatGPT is that they suggest using a style section, but whever I try to use it I get errors.
Just as an example of Grist HTML giving me an error whenever I try to add a STYLE…
I tried to add headers to each bage and page breaks in the tables, according to this post
About css shenanigans, honestly, I don’t know the miracle to avoid that pain each time one has to create a new page style: I struggle with it myself on any new project I launch.
But it’s incredible that I am doing everything in order to make the cells closer but nothing works. The result is that the form on top (training info) is occupying over half the page. Well, this is an HTML problem. I might as well post anywhere else, instead of bothering you anymore JPeron. Thank you very much for all the help you already gave.