Hi,

I'm currently running Crystal Reports 8.5 from PHP using COM..(yes I know that is an older version of Crystal)...I am also running PHP on localhost.

The following code:

<?php
$crapp = new COM ("CrystalRuntime.Application") or die ("Error on load");
$creport = $crapp->OpenReport("c:/test.rpt", 1);
$creport->ExportOptions->DiskFileName="c:/test.rtf";
$creport->ExportOptions->DestinationType=1; // Export to File
$creport->ExportOptions->FormatType=4; // Type: RTF
$creport->DiscardSavedData();
$creport->Export(false);

$creport = null;
$crapp = null;

print "...done";
?>

works fine until I run it more than 5 times, at which point I get the error:

"Warning: Invoke() failed: Exception occurred. Source: Crystal Reports ActiveX Designer Description: There are not enough Concurrent Access Licenses to log you on. This system has 5 Concurrent Access Licenses."..etc..etc..

Now I know why this is happening. I assume it is because I am not closing the COM instances of 'Crystal Reports ActiveX Designer'. I am setting the '$crapp' object to null but I guess this still leaves the actual App instantiated. However, I can't find out how to programmatically close the App. I have tried:

$crapp->Close();
$crapp->Quit();

Does anyone know either the command(s) I require to cleanup my 'Crystal Reports ActiveX Designer' session, or if not, can you suggest a good reference for the Crystal 8.5 COM commands because I can't find one.

Thanks...😉

    Write a Reply...