• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 707
  • Last Modified:

How do I run a Crystal Report in PHP

Hi,
I'm fairly well up on straight PHP but don't know much about Crystal Reports and know even less about how to get the two to work together.
A friend and I have managed to create a crystal report that we can run directly localhost.
I have created a php ticket logging website which has a page ready to be coded up to hold the report.
Basically this is a stats report on a database ticket system. Once a month we would like someone to be able to run the report via the website rather than directly on the machine.

I would like some advice on where to start. I have had a good look through other questions but they all seem to be about errors people are facing. What I need is help on where to start. I have PHP running on a windows machine with an sql database. I have absolutely no idea where to go from here. Any advice would be greatly appreciated, even if its just a link to another answer which I have missed that explains stuff from the start.

Thanks in advance
0
senda_letter
Asked:
senda_letter
  • 2
  • 2
1 Solution
 
Beverley PortlockCommented:
If there is a command line option for running a crystal report then you could look at using exec()

http://uk2.php.net/manual/en/function.exec.php

You say you can run it directly via localhost - do you mean on the local host or via the ip pseudo-address localhost?
0
 
senda_letterAuthor Commented:
I am not aware of a way to run it by command line but that doesnt mean there isnt.

I can run it in crystal reports on the machine itself using the crystal reports software.
0
 
Beverley PortlockCommented:
If there is no command line option then the COM interface may be your only hope.

http://uk.php.net/manual/en/class.com.php

These are installed as part of the Windows Installation of PHP, but I have no idea about COM programming (not being a Windows type). I did come across this

http://tech.groups.yahoo.com/group/phpexperts/message/3231

$cr=new com("Crystal.CRPE.Application") or die("cannot load cr com");
$rn="F:\notes5\test.rpt";
$rap=$cr->OpenReport($rn);

Hope that helps
0
 
senda_letterAuthor Commented:
Thanks. I'll give that a try see if it works.
0
 
mlmccCommented:
THere is no command line interface to Crystal.

mlmcc
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now