On 3 January 2013 03:05, findatanet <findatanet@xxxxxxx> wrote: > > I am working on a project to update reporting on a system. On each report, > the current system uses PHP to make one or more mySQL queries, iterates > through the query results and manipulates the data, and then generates HTML > for display. I am tasked with changing the reports to use Crystal Reports > to make them look nicer and to generate PDFs. > > I have seen many examples of using COM to create an object factory, to > create a CR app, load the report, and generate a PDF. However, all of the > examples just load the CR .rpt file, pass the database logon parameters, and > use a direct connection to the database to generate the report. > > In .Net and Java, I am able to generate data tables or data sets that I can > hand to the CR .rpt file once I have loaded it. This would be handy to do > in this case because the PHP code already produces the data that needs to go > on the report. > > Is there a way to do this or will I need to rewrite the PHP code as SQL > procedures that I can use to generate the reports? > > Thanks very much! > > David > > > -- > View this message in context: http://old.nabble.com/PHP-and-Crystal-Reports-tp34853739p34853739.html > Sent from the Php - Windows mailing list archive at Nabble.com. > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > As someone who has used PHP+COM+Crystal Reports, build the reports in Crystal so you can test them and then automate the report production in PHP. You can use PHP to feed in run time params (so if you have a web front end asking, for example, customer account number), then you can pass that to the report and get a report for that customer. You can then export the report to PDF and email it. Now, if you wanted to put the account number retrieval from the DB into PHP and loop through the results, passing each account number to the report, generate it, export it, email it, you may have a mass emailer solution of high quality PDFs from Crystal Reports. You _can_ build the entire report from scratch using PHP+COM if you want. So, with no rpt file, nothing. But it is a LOT of work. If you've ever seen how a GUI app's forms are laid out, every single component has a whole load of attributes, all of which need to be set appropriately. Add to that nested elements, sub-reports, totals, formulas, etc. Like I said, you CAN do that all via COM, but it is horrendously long winded. It will be a LOT quicker to do it by hand in Crystal Reports and just use the runtime report production for PHP. Richard. -- Richard Quadling Twitter : EE : Zend @RQuadling : http://e-e.com/M_248814.html : http://bit.ly/9O8vFY -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php