Hi!
I'm generating several "report" pages with a combination of SQL queries that result in pages of varying length depending on the SQL output. My client needs these pages to be printable and has requested that I figure out how to create "page breaks" when printed. I have to display header/footer info for each "page" and they'd like page numbering as well. I've just started messing with PDF generation, and while this seems like the way to go, its very tedious, especially when dealing with dynamic data (as from a db query). Anyone have any ideas for "paging" html output with PHP other than through PDF generation? Any help is GREATLY appreciated!
Creating Printable, Multi-paged Reports from SQL Query
Moderator: General Moderators
Re: Creating Printable, Multi-paged Reports from SQL Query
One thing I can imagine using PDF is to send content with the PDF MIME-Type (whatever it is) to the browser. That way you won't have to create files.Venona69 wrote:Hi!
I'm generating several "report" pages with a combination of SQL queries that result in pages of varying length depending on the SQL output. My client needs these pages to be printable and has requested that I figure out how to create "page breaks" when printed. I have to display header/footer info for each "page" and they'd like page numbering as well. I've just started messing with PDF generation, and while this seems like the way to go, its very tedious, especially when dealing with dynamic data (as from a db query). Anyone have any ideas for "paging" html output with PHP other than through PDF generation? Any help is GREATLY appreciated!
Otherwise, there's no way you can ensure that it'll fit on someone's page, it depends how their printer is set up - margins and all - as well as their font presets in their browser that override yours and/or printer compatibility (or lack thereof) of the fonts you used. Also, page size will be a problem, as the standard-use page-size varies from country to country. In Europe, it's generally A4, whereas in the US it's the Letter Format (AFAIK).
Cheers,
Tom