skycruiser Posted March 14, 2007 Share Posted March 14, 2007 Is there a simple solution for generating mysql db reports with php? I can make tables but I'd like to make something that partitions the pages properly for printing. I've looked at some of the sw packages on the web and they either look too complicated or too simple (it's not just a table dump - there is some processing involved). I guess I'm looking for a tutorial to do it myself. I just don't know how to format teh output for printing. I could wing it by trial and error but if I'm going by number of rows or somethign to cutoff the page a single line wrap in a row would throw it all off. So far my db is just php/mysql with standard html (tables and stuff). I haven't gotten into css yet but I'm guessing I could need it to make this work. Any help is greatly appreciated !! Oh if it wasn't clear I'm talkign about reports users can generate through the website. They don't have to design the report, just view a report with the current db data. I'll design the report formats. Thanks. Michael Quote Link to comment Share on other sites More sharing options...
brad Posted March 14, 2007 Share Posted March 14, 2007 maybe look at generating it as a PDF then printing it? sure there'll be some good PDF tutorials out there that might help you. i'm just not sure how this question can be solved using just php/html. Quote Link to comment Share on other sites More sharing options...
skycruiser Posted March 14, 2007 Author Share Posted March 14, 2007 HI Brad, I looked into a few PDF report generators. One problem is at least the 2 I checked require you to design the layout based on existing tables in the db and doesn't let you do any real time processing. A lot of what I need to display isn't in the tables but is generated from them so I can't just drop the content into the report - some columns that would need to be displayed for example are created by users so I don't even know the names of them to design the report. Some of that has to be dynamic. I saw a website describing how to design a book using CSS with proper formating and page breaks for printing but the software was $375 or something like that. ALso that's probably overkill. The reports are fairly simple, headers/footers/page nums and content. I can throw together headers and stuff just not sure about figuring the page breaks. It's sad to say it but that is one big plus with MSAccess is it's easy to design printable reports. I just hate Access so much I refuse to mess with it. Quote Link to comment Share on other sites More sharing options...
interpim Posted March 14, 2007 Share Posted March 14, 2007 maybe Pagination will work? would require the user to click a next page or the like link, but would probably work if I understand your problem correctly Quote Link to comment Share on other sites More sharing options...
skycruiser Posted March 14, 2007 Author Share Posted March 14, 2007 interpim - thanks! Using that term is broadening my search. If I figure out the general mechanics of pagination I may be able to use that to create the whole general document. Quote Link to comment Share on other sites More sharing options...
skycruiser Posted March 16, 2007 Author Share Posted March 16, 2007 I found FPDF and so far it's working great. The tutorials explain everythign and all i have to do is include the FPDF.php file Thanks for the advice all. Michael Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.