I have done some research into converting a MySQL table to a PDF file and I think I will eventually get this to work.
But if someone has already figured this out, I would be pleased to hear from you.
Mike
I have done some research into converting a MySQL table to a PDF file and I think I will eventually get this to work.
But if someone has already figured this out, I would be pleased to hear from you.
Mike
Hi @mdsmith1 Did you already implement this? One idea is to use the pdf exporter query type, as explored here
The pdf exporter is somewhat limited though. This blog post explores other ways to generate PDFs from Retool, such as a download button or using an external api
Download button example:
Tess, I think this is probably all I need but I can't get it to work.
I am sending screen capture. I have asked it to print fields Field1, Field2, Fierld3 and Field4 and it just prints out these words as a header.
How does this work?
Mike
The PDF Content needs to be formatted as markdown, which is why I mentioned it can be very limited. There isn't much flexibility with styling and it can be tedious to map out the data you need properly.
Headers from table could be formatted like this:
const headers = [Object.keys({{ table1.data }}[0])];
const breaks = [headers[0].map(() => "---")];
const tableEntries = headers.concat(breaks);
return tableEntries.map((row) => "|" + row.join("|") + "|").join("\n");