views:

423

answers:

5

I have been asked to find out if it is possible to connect Cyrstal Reports to a MYSQL database within a php website.

  1. Is this possible?
  2. Are their any alternatives

Thanks

Edit I suppose in the perfect world I am wanting to show crystal reports within a PHP website

+1  A: 

Your question isn't very clear, if you're trying to ask if you can connect Crystal Reports to a MySQL database (a MySQL database that is connected to a PHP site) then you might be able to, have a look at this article.

If you're tying to connection Crystal Reports to a MySQL database and embed it within a PHP application... well I'm not too sure, perhaps someone else can tackle this problem.

http://www.eakes.org/80/connecting-to-mysql-with-crystal-reports-xi/

ILMV
+1  A: 

As an alternative you can use iReport. You can use it just as you need, with a mysql database from a php website.

Adrian Faciu
+1  A: 

In response to your comment:

I would want to show CR within the PHP website

CR being a Windows executable, this will not be directly possible (aside from embedding a Remote Desktop or VNC instance, but this is probably not feasible, and would not be legal.)

Your best bet is to check whether CR has an export format that can be embedded into the web site: PDF, HTML, XML come to mind. Those you could insert into your web page manually.

If you want automated interaction between the web site's user and CR, this probably possible, but not going to be trivial. There are third party products that allow controlling CR from the command line. You may be possible to set up an interaction between PHP and Crystal Reports through the command line on a Windows server, but it's going to be a lot of work.

Pekka
+1 thanks for answer. I will try and lead the client down another route, unless the php site is running on a windows server, then I can grab the data using a odbc connection and use .net
Fred Smith
Yup, sounds like a good idea. Using CR in an automated way like this on a public web site could also lead to license issues, you would have to check the license agreement. You can use ODBC to query remote mySQL databases as well btw, mySQL doesn't need to run on the same machine. You just need Connector/ODBC installed on the windows machine.
Pekka
A: 

Using Crystal Reports to generate reports from a mySQL data base works fine. Install the latest and greatest mySQL ODBC driver and just do it.

If you want to serve up pre-generated Crystal report .rpt files via a PHP-based web site, that is straightforward. You can ask your users to download the Crystal Report Viewer, and just send out those files as if they were, say, .doc or .xls files.

The viewer is here.

The tricky bit is generating Crystal files on demand. You'll need to control the Crystal instance based on input from your web site users. You'll need to ask them to wait while Crystal runs. SAP sells a server edition of their product for this purpose that works well, but it costs money.

Groff Automation makes a product called Crystal Delivery. It works well for running routine reports.

Ollie Jones
A: 

I think its possible

because