on 03-10-2009 8:48 PM
I have tried copying various snippets of PHP code to render a Crystal Report in PDF which I can then stream to the browser, but I never get past the creation of the CrystalRunTime.Application. (Earlier examples had CrystalDesignRunTime.Application instead; they did not work either). Any suggestions what is wrong here?
$ObjectFactory= new COM("CrystalReports12.ObjectFactory.1") or die ("Error on load");
echo "<p>ObjectFactory created.<p>About to create CrystalRunTime.Application...";
try {
$crapp = $ObjectFactory-> CreateObject("CrystalRunTime.Application");
} catch (com_exception $e) {
echo("Error on instance creation:<br>".$e->getMessage().'<p>'.$e->getTraceAsString());
echo "<p>".$e;
exit;
}
Here is the output:
ObjectFactory created.
About to create CrystalRunTime.Application...Error on instance creation:
Source: Unknown
Description: Unknown
#0 C:\xampp\htdocs\tempo\comtest.php(11): com->CreateObject('CrystalRunTime....') #1 exception 'com_exception' with message 'Source: Unknown Description: Unknown' in C:\xampp\htdocs\tempo\comtest.php:11 Stack trace: #0 C:\xampp\htdocs\tempo\comtest.php(11): com->CreateObject('CrystalRunTime....') #1
I am having this problem as well.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
$ObjectFactory= New COM("CrystalReports11.ObjectFactory.1");
//------ Create a instance of library Application -------
try
{
$CRobj = $ObjectFactory->CreateObject("CrystalRunTime.Application.11");
}
catch (com_exception $e)
{
echo("<br>Error on instance creation:<br>".$e->getMessage().'<p>'.$e->getTraceAsString().'</p>');
echo "<p><pre><code>".print_r($e, true)."</code></pre></p>";
exit;
}
Source: Unknown
Description: Unknown
#0 C:\xampp\htdocs\analytics\generate_cr.php(103): com->CreateObject('CrystalRunTime....') #1 {main}
com_exception Object
(
[message:protected] => Source: Unknown
Description: Unknown
[string:Exception:private] =>
[code:protected] => -2147352567
[file:protected] => C:\xampp\htdocs\analytics\generate_cr.php
[line:protected] => 103
[trace:Exception:private] => Array
(
[0] => Array
(
[file] => C:\xampp\htdocs\analytics\generate_cr.php
[line] => 103
[function] => CreateObject
[class] => com
[type] => ->
[args] => Array
(
[0] => CrystalRunTime.Application.11
)
)
)
[previous:Exception:private] =>
)
Edited by: EddieM on Dec 9, 2009 9:34 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.