Cetak Crystal Report Dengan PHP
Cetak Crystal Report Dengan PHP
Ali Presence
APRIL 23, 2013 · 12:21 PM
Im using Crystal Reports 10, MS SQL Server 2005, Apache2, and PHP5.
My report uses an SQL Store Procedure and passes some parameter to get the report data, so our PHP must set
the database logon info and pass the parameters.
<?php
//—— Variables ——
$my_report = “C:\\Apache2\htdocs\\test\\MyReport.rpt”; //This must be the full path to the file
$my_pdf = “C:\\Apache2\htdocs\\test\\MyReport.pdf”;
//—— Suppress the Parameter field prompt or else report will hang ——
$creport->EnableParameterPrompting = 0;
1 of 3 30/03/2015 11:18
Example to print Crystal Report in php | Ali Presence https://asabali.wordpress.com/2013/04/23/example-to-print-crystal-report...
?>
Obviously there’s plenty of room for refinement in there, but it works and should get you going on the right track.
I also found that during testing, the script was hanging before supressing the parameter prompt. Once this had
happened, some exports that had been working earlier stopped completely and wouldn’t work again untill I
restarted Apache.
Share this:
Related