Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > PHP Databases
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old September 8th, 2003, 07:38 AM
Registered User
 
Join Date: Sep 2003
Location: Paris, , France.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to largecinq
Default Crystal Reports 9 and PHP

Hi everybody,

I have a BIG problem with Crystal Reports 9. I try to print a report from a PHP page and it doesn't seem to work. Could anyone give me a hint why it's not working ? (Code following)

$crapp = new COM("CrystalRuntime.Application.9");
$creport = $crapp->OpenReport("C:\\Foxserv\\www\\Etat1.rpt", 1);

$creport->DiscardSavedData();
$creport->ReadRecords();

echo 'Driver Name : ' . $creport->DriverName.' **<br>';
echo 'Printer Name : ' . $creport->PrinterName.' **<br>';
echo 'Port Name : ' . $creport->PortName.' **<br>';

$creport->SelectPrinter("HP LaserJet 1100(MS)", "HPLocal", "LPT1:");
$creport->PaperOrientation = 0;

$creport->PrintOut(False);
echo 'creport->PrintingStatus->Progress : ' . $creport->PrintingStatus->Progress . '<br>';

All this displays :

Driver Name : DISPLAY **
Printer Name : **
Port Name : **
creport->PrintingStatus->Progress : 3

I can't figure why the driver name is DISPLAY and it's killin' me

Thanx for all ideeas.



Reply With Quote
  #2 (permalink)  
Old September 8th, 2003, 02:50 PM
Friend of Wrox
Points: 2,570, Level: 21
Points: 2,570, Level: 21 Points: 2,570, Level: 21 Points: 2,570, Level: 21
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: San Diego, CA, USA
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I wish I could help you. I tried searching on Google and couldn't find the Crystal Reports COM API documented. Crystal Reports is commercial software, perhaps as a licensed user you can call them or look through their support pages for the documentation.

Also, whenever dealing with objects or complex variables in PHP, it helps to make use of the var_dump() and/or print_r() functions.
  http://www.php.net/var_dump
  http://www.php.net/print_r

They may shed some light on your object by displaying the internal variable structure.

Don't forget to wrap the output in <pre></pre> tags so it's readable.


Take care,

Nik
http://www.bigaction.org/
Reply With Quote
  #3 (permalink)  
Old January 31st, 2005, 11:19 PM
Registered User
 
Join Date: Jan 2005
Location: Bangalore, Karnataka, India.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to divya1111
Default

I need to generate crystal reports. I am using PHP & MySQL on Linux Platform. is it possible to generate crystal reports?? the internet is not helping me. If u can tell me what extra tools are to be installed and also give me a tinzy winzy example I will be able to continue.

divya
Reply With Quote
  #4 (permalink)  
Old May 29th, 2006, 01:47 AM
Registered User
 
Join Date: May 2006
Location: New Delhi, New delhi, India.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello Divya...
can you please send me some links or code regarding your problem...i too using Crystal reports XI...kindly send me or tell me abt "How to generate Crystal reports with PHP". i think we need to use some Third party tool for this..thanx in advance.
Raman

Raman Kheterpal
Web Programmer
Centre for IT Applications (CITA)
T E R I, India Habitat Centre,
Lodhi Road, New Delhi- 110003
Reply With Quote
  #5 (permalink)  
Old July 10th, 2006, 07:02 AM
Registered User
 
Join Date: Jul 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

please i want know how, to generate Crystal reports with PHP.

Reply With Quote
  #6 (permalink)  
Old September 8th, 2006, 12:26 PM
Registered User
 
Join Date: Sep 2006
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Crystal Reports is a Windows only app

PHP COM function can interact with CR

Code:
you can do it with COM, check out
http://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);

I wish my computer would do what I want it to do, not what I tell it to do
Reply With Quote
  #7 (permalink)  
Old June 5th, 2007, 02:05 PM
Registered User
 
Join Date: Jun 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

did someone solve this problem?, Me too, I need to generate a Crystal reports format report with data from MySQL database and using PHP. all the anwsers I got are create a COM object and open a .rtp file, do something;

- My question is where can I get a .rtp file, is this file the final result for me?
- If this is the resulted file, someone will download and display with their Crystal Report software, then what I need is the export my data from database( as I did for CSV file) to .rtp file. is there a file in PHP to do that, or Crystal Report COM object has this functionality;


I really need your urgent help;


Thank you in advance


JZ

Reply With Quote
  #8 (permalink)  
Old September 2nd, 2007, 05:16 AM
Registered User
 
Join Date: Sep 2007
Location: Dhaka, Dhaka, Bangladesh.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi there,
please provide me some code sample of showing crystal report in php.

Mamun
samamun001@yahoo.com
Reply With Quote
  #9 (permalink)  
Old July 17th, 2008, 06:53 AM
Registered User
 
Join Date: Jul 2008
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi All,

I m tring to integrate the Crystal report wiht PHP

$COM_Object = "CrystalReports12.ObjectFactory.1";
$my_report = "C:\\Report1.rpt";
$ObjectFactory= New COM($COM_Object);
$creport = $ObjectFactory->OpenReport("c://report1.rpt", 1);

It gieves following error
>>>>>>>>>>>>>>>

Call to undefined method com::OpenReport()
please advice
santosh
Reply With Quote
  #10 (permalink)  
Old July 18th, 2008, 04:52 AM
Registered User
 
Join Date: Jul 2008
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by santosh5266
ANy setting in php.ini file?
 Hi All,

I m tring to integrate the Crystal report wiht PHP

$COM_Object = "CrystalReports12.ObjectFactory.1";
$my_report = "C:\\Report1.rpt";
$ObjectFactory= New COM($COM_Object);
$creport = $ObjectFactory->OpenReport("c://report1.rpt", 1);

It gieves following error
>>>>>>>>>>>>>>>

Call to undefined method com::OpenReport()
please advice
santosh
santosh
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP with Crystal Reports XI khe_raman PHP How-To 0 May 29th, 2006 02:20 AM
how to get reports in crystal reports using ASP3.0 candy133 Classic ASP Basics 2 January 26th, 2006 07:26 AM
Comparitive Reports in Crystal Reports tarunm Crystal Reports 1 January 21st, 2006 12:08 AM
comparision among crystal reports and Data reports avats Crystal Reports 0 April 13th, 2005 01:01 PM
How to create/design reports with crystal reports BassmaniaQ Crystal Reports 0 December 14th, 2004 03:58 AM



All times are GMT -4. The time now is 02:44 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.