[PHP] Dynamic Generating reports to print
Hi, I'd like to generate reports (with tabular data) to print from php. Now I am using a mixed solution where I save the data in a reports database and I have a delphi app installed pooling the db for pending reports and print it. My plan is move away from the current solution but I am still confused of how am I going to get control of the layout of the report. Generate a PDF ? Use CSS ? Some of the trick parts are, for instance, to have the same header in all pages of the same report, if I have tabular data greater than the height of the page continue in the next page etc. Any tips (or code) ? thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dynamic Generating reports to print
My plan is move away from the current solution but I am still confused of how am I going to get control of the layout of the report. Generate a PDF ? Use CSS ? Some of the trick parts are, for instance, to have the same header in all pages of the same report, if I have tabular data greater than the height of the page continue in the next page etc. I used to encounter the same problems with reporting in our business software. You can generate reports and spit out HTML in a new window and have the user print the report from the browser, but that has many drawbacks. It only works with simple data sets, its difficult (or impossible) to control page breaks, lack of precision placing, etc. Now I use FPDF to generate PDF reports (http://www.fpdf.org/). Its free, easy to use, and pretty flexible. It allows you to do precision placement on a page, add headers, footers, etc, etc, etc. Be sure to check out the Scripts section, its got a bunch of useful tips for expanding functionality of the classes. There is another commerical product out there (can't thin of the name right now) that is supposed to be faster, but FPDF is pretty fast in our applications. I also use the JPGraph package for generating graphs (http://www.aditus.nu/jpgraph/). This is *really* slick. Its free for personal use, about $125 for commercial use. You need to install some additional PHP libraries (JPEG, PNG, GD at least), but its fast and easy. I love playing around with this product because the possibilities for what you can do are almost endless. HTH, Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dynamic Generating reports to print
The commercial product you might be thinking off might be Crystal Reports: http://www.businessobjects.com/. I have not worked with their product since their version 7, but I remember that if you wanted a report in HTML what they did is send zillions of absolutely positioned divs with width and height spec and assembled the page from those. It did not require any plug-in installed on the client side. It used the page-break-after or -before CSS attribute for page breaks. Satyam Steve Brown [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] My plan is move away from the current solution but I am still confused of how am I going to get control of the layout of the report. Generate a PDF ? Use CSS ? Some of the trick parts are, for instance, to have the same header in all pages of the same report, if I have tabular data greater than the height of the page continue in the next page etc. I used to encounter the same problems with reporting in our business software. You can generate reports and spit out HTML in a new window and have the user print the report from the browser, but that has many drawbacks. It only works with simple data sets, its difficult (or impossible) to control page breaks, lack of precision placing, etc. Now I use FPDF to generate PDF reports (http://www.fpdf.org/). Its free, easy to use, and pretty flexible. It allows you to do precision placement on a page, add headers, footers, etc, etc, etc. Be sure to check out the Scripts section, its got a bunch of useful tips for expanding functionality of the classes. There is another commerical product out there (can't thin of the name right now) that is supposed to be faster, but FPDF is pretty fast in our applications. I also use the JPGraph package for generating graphs (http://www.aditus.nu/jpgraph/). This is *really* slick. Its free for personal use, about $125 for commercial use. You need to install some additional PHP libraries (JPEG, PNG, GD at least), but its fast and easy. I love playing around with this product because the possibilities for what you can do are almost endless. HTH, Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dynamic Generating reports to print
On 24/04/2005, at 12:43 AM, Steve Brown wrote: I used to encounter the same problems with reporting in our business software. You can generate reports and spit out HTML in a new window and have the user print the report from the browser, but that has many drawbacks. It only works with simple data sets, its difficult (or impossible) to control page breaks, lack of precision placing, etc. Now I use FPDF to generate PDF reports (http://www.fpdf.org/). Its free, easy to use, and pretty flexible. It allows you to do precision placement on a page, add headers, footers, etc, etc, etc. Be sure to check out the Scripts section, its got a bunch of useful tips for expanding functionality of the classes. There is another commerical product out there (can't thin of the name right now) that is supposed to be faster, but FPDF is pretty fast in our applications. I find doing it this way a total pain in the ass, I have in the past used htmldoc , to generate html to pdf , it has special tags to do certain things in the pdf's. Seriously drawing it like this is time consuming. I would suggest report designers like report manager and jasper reports. Currently for Excel I have built a subclass to the PEAr structures datagrid which uses the excel spreadsheet renderer, and i give it a database resultset, currently the dataobject, and then it will generate the columns dynamically from the query. I have given it extra methods to display extra stuff in the header and footer ie for formulas , and special formatting on the cells. But pdf's are nice if the user doesnt need to collate the data just print it. The funky thing with Jasper reports is, you can maniuplate the xml based files, say build a web frontend to build a report builder, so the user doesnt need to use gui tools like iReport to create report templates. So you let them select the fields you want, and u do the sql and xml generating in the backend. To do it currently, the fields have to be statically setup , it also however requires a Jsp to run a servlet to compile the reports. Reportman however runs a cgi report server, but cant do excel on unix. I also use the JPGraph package for generating graphs (http://www.aditus.nu/jpgraph/). This is *really* slick. Its free for personal use, about $125 for commercial use. You need to install some additional PHP libraries (JPEG, PNG, GD at least), but its fast and easy. I love playing around with this product because the possibilities for what you can do are almost endless. This is really sweet however it doesnt have PHP5 support ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php