Python Forum
How do I generate reports in pdf format? - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: How do I generate reports in pdf format? (/thread-23687.html)



How do I generate reports in pdf format? - okbeat9 - Jan-12-2020

I have a template that is of A4 landscape size and the data to be filled in it is in a csv file. Basically each row for 1 report. I have generated the report in MS Access. But I want without the gui.

Basically data is just stored in the csv file.

I want to create "report.py", which when clicked, will check which is the last invoice number in the excel sheet and collect all the rows with the same invoice number and generate a report with that. Also have the option that when I run via cli, "python3 report.py 5 15". It will print all the invoices from 5 to 15.

My question is what libraries/tools do I use?


RE: How do I generate reports in pdf format? - buran - Jan-12-2020

reportlab is one option
Here is step by step tutorial
https://www.blog.pythonlibrary.org/2010/03/08/a-simple-step-by-step-reportlab-tutorial/


RE: How do I generate reports in pdf format? - okbeat9 - Jan-13-2020

(Jan-12-2020, 06:17 PM)buran Wrote: reportlab is one option
Here is step by step tutorial
https://www.blog.pythonlibrary.org/2010/03/08/a-simple-step-by-step-reportlab-tutorial/

Thanks.

The whole canvas.drawString() & canvas.line() and complexities for drawing a table. Isn't there a simpler option like HTML? Considering all the post is from 2010, has there been changes?