Hi, I am new to crystal report. I want to use CR 11 integrated with my web based application. Now as entire application is designed in PHP, I need to use PHP, use COM, to pass parameters and generate PDF report.
I have following question.
Will I need CR server ?
How do i actually invoke CR from PHP ?
Right now I am doing following
$my_report = "C:
Inetpub
wwwroot
test
test.rpt";
$my_pdf = "C:\Inetpub\wwwroot\test
MyReport.pdf";
try
{
$ObjectFactory = new COM ( 'CrystalRuntime.Application' );
}
catch ( exception $e )
{
echo 'caught exception: ' . $e->getMessage () . ', error trace: ' . $e->getTraceAsString ();
}
$crapp = $ObjectFactory->CreateObject("CrystalDesignRunTime.Application");
$creport = $crapp->OpenReport($my_report, 1);
$creport->Database->Tables(1)->SetLogOnInfo("server IP address", "db_name", "username", "password");
$creport->EnableParameterPrompting = 0;
$creport->DiscardSavedData;
$creport->ReadRecords();
$creport->FormulaFields->Item(1)->Text = ("'My Report Title'");
$creport->ParameterFields(1)->AddCurrentValue ("FirstParameter");
$creport->ParameterFields(2)->AddCurrentValue (2000);
$creport->ExportOptions->DiskFileName=$my_pdf;
$creport->ExportOptions->PDFExportAllPages=true;
$creport->ExportOptions->DestinationType=1;
$creport->ExportOptions->FormatType=31;
$creport->Export(false);
$creport = null;
$crapp = null;
$ObjectFactory = null;
but i am getting following error
caught exception: Failed to create COM object `CrystalRuntime.Application': Invalid syntax , error trace: #0 C:\Inetpub\wwwroot\cr_test.php(69): com->com('CrystalRuntime....') #1 Notice: Undefined variable: ObjectFactory in C:\Inetpub\wwwroot\cr_test.php on line 78 Fatal error: Call to a member function CreateObject() on a non-object in C:\Inetpub\wwwroot\cr_test.php on line 78
I will appreciate any help provided in this matter
Request clarification before answering.
Hi,
Can you please let me know list of supported languages ?
Thanks and Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Version 14?!
Where did this come from? Are you using the Beta of CRVS2010?
Note that CR XI R2 (11.5) was the last version of CR to ship the rdc (craxdrt.dll.). Using the craxdrt.dll from any other version is not within your license agreement...
Also, even if you go with the RDC, breaking your license agreement, you will never be able to deploy the CR runtime successfully as there are no MSM or MSI files...
- Ludek
Edited by: Ludek Uher on Jun 13, 2011 6:37 AM
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.