Formatting text

Hi All,

Im trying to format some text data into columns that gets exported to pdf

Ive got all of that working but the data is all over the place.

I couldnt see a node that will do it?

I have the data in a ui table but unfortunately I dont believe you can just export that.

Can anybody give me some advice on which way to go?

Thanks in advance.

If you've got the data into a Dashboard table, you should have the input data already in a useful format - e.g. an array of objects where each object is key'd on column names.

There are various ways to get that to a PDF. Check out the Flows site for ideas. I think that nodes that use pdfmake would do the job.

https://flows.nodered.org/search?term=pdf&type=node&type=flow&type=collection

I've also published a flow that shows how to write full HTML reports using UIBUILDER that you can simply print to PDF if you have a suitable print driver which most modern OS's should have. That is similar to using pdfmake but outputs direct to HTML rather than direct to PDF.

Since publishing that flow, UIBUILDER has gained further capabilities and you could now do the same thing all in Node-RED if you wanted to by using the uib-element node set to output a table and then the uib-html node to convert direct to HTML (or output to a uibuilder node as normal), you could then save that to a file or send to print as needed.

So lots of choice as always with Node-RED.

Thanks for the reply.

Im using PDFmake and it works well.

I just thought there might be an easy way.. I will keep looking