Próbuję wygenerować raport kryształu za pomocą skryptu php. Skrypt wydaje się zawieszać zaraz po ReadRecords(); W pliku dziennika nie jest generowany komunikat o błędzie. Czy robię coś złego?Generowanie raportu Crystal za pomocą PHP zawiesza się
$my_report = "C:\\inetpub\\wwwroot\\mamobile\\reports\\invoice.rpt";
$my_pdf = "C:\\inetpub\\wwwroot\\mamobile\\reports\\test.pdf";
$ObjectFactory = new COM("CrystalReports115.ObjectFactory.1");
$crapp = $ObjectFactory->CreateObject("CrystalDesignRuntime.Application.11");
$creport = $crapp->OpenReport($my_report, 1);
$creport->EnableParameterPrompting = 0;
$creport->DiscardSavedData;
$creport->ReadRecords();
$creport->FormulaSyntax = 0;
$creport->RecordSelectionFormula = "{invoice.invoiceid} = 20070128114815";
$creport->ExportOptions->DiskFileName = $my_pdf;
$creport->ExportOptions->FormatType = 31;
$creport->ExportOptions->DestinationType=1;
$creport->Export(false);
$creport = null;
$crapp = null;
$ObjectFactory = null;
Podobna wersja tego kodu działa w przypadku innego raportu.
$my_report = "C:\\inetpub\\wwwroot\\mamobile\\reports\\" . $name;
$my_pdf = "C:\\inetpub\\wwwroot\\mamobile\\reports\\test.pdf";
$ObjectFactory = new COM("CrystalReports115.ObjectFactory.1");
$crapp = $ObjectFactory->CreateObject("CrystalDesignRuntime.Application.11");
$creport = $crapp->OpenReport($my_report, 1);
$creport->EnableParameterPrompting = 0;
$creport->DiscardSavedData;
$creport->ReadRecords();
$creport->ExportOptions->DiskFileName = $my_pdf;
$creport->ExportOptions->FormatType = 31;
$creport->ExportOptions->DestinationType=1;
$creport->Export(false);
$creport = null;
$crapp = null;
$ObjectFactory = null;
Dzięki za to. Zostałaś użądlona przez to samo pytanie, które zrobiłem - CrystalRuntime, a nie CrystalDesignRuntime – Patrick