How do I run a Crystal Report in PHP

Posted on 2008-11-04
Last Modified: 2013-12-13
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
Question by:senda_letter
    LVL 34

    Expert Comment

    by:Beverley Portlock
    If there is a command line option for running a crystal report then you could look at using exec()

    You say you can run it directly via localhost - do you mean on the local host or via the ip pseudo-address localhost?

    Author Comment

    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.
    LVL 34

    Accepted Solution

    If there is no command line option then the COM interface may be your only hope.

    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

    $cr=new com("Crystal.CRPE.Application") or die("cannot load cr com");

    Hope that helps

    Author Comment

    Thanks. I'll give that a try see if it works.
    LVL 100

    Expert Comment

    THere is no command line interface to Crystal.


    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
    Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now