Background
This is only my second PyQt4 project. Developing a Windows app that has INVOICE management as one of its components.
Question
I need suggestions on how to successfully create a list that can be cleanly printed even if it spans across multiple pages.
Something like QTableView or QTableWidget.
UI Details
Few Header Lines (Client info, invoice number etc) followed by rows of:
| SKU # | NAME | DESCRIPTION | QUANTITY | PRICE
With some subtotals and grand totals on the bottom.
Print Functionality
When [Ctrl]+P is pressed or File–>Print is selected, system printer dialog should pop-up allowing you to print the invoice that can span multiple Letter sized pages.
Optionally, is there a quick and easy way to implement a print preview?
I don’t want to spend 3 days using QTableWidget + QPrinter only to find out that it cannot do what I need it to do. Looking for help/tips/insight from your past experience that will save me time and effort.
Thanks
I pretty sure everything you want to achieve is possible using PyQt4.
I have added a basic script below which demonstrates the functionality you’re after. The format of the printed table is very crude, but you could easily achieve something fancier by using html instead of the simple text-table I’ve used.