FR in separate thread PrepareReport returns false
Hi,
I'm trying to prepare a FR through Intraweb.
Having read documentation I produce this code :
TfrxReport *FReport=new TfrxReport(NULL);
FReport->EngineOptions->SilentMode = True;
FReport->EngineOptions->EnableThreadSafe = True;
FReport->EngineOptions->UseFileCache = false;
FReport->EngineOptions->DestroyForms = false;
FReport->EngineOptions->UseGlobalDataSetList = False;
FReport->ShowProgress = False;
TfrxPDFExport *PDF=new TfrxPDFExport(NULL);
PDF->FileName=MaSession->NomFichierExcel;
PDF->ShowDialog = False;
PDF->ShowProgress = False;
TfrxDBDataset *frxDBDataset2=new TfrxDBDataset(NULL);
frxDBDataset2->DataSet=MaSession->ModuleProduits->RetraitLieu;
int i=frxDBDataset2->DataSet->RecordCount; //One record got Ok!
FReport->EnabledDataSets->Add(frxDBDataset2);
if(FileExists(s+"retrait.fr3"))
FReport->LoadFromFile(s+"retrait.fr3");
if(FReport->PrepareReport())
FReport->Export(PDF);
delete FReport;
delete frxDBDataset2;
delete PDF;
This code is set in the Execute() procedure of a specific thread.
The problem is that PrepareReport returns false.
I couldn't get informations for this case.
Can anyone help me?
Thanks.
I'm trying to prepare a FR through Intraweb.
Having read documentation I produce this code :
TfrxReport *FReport=new TfrxReport(NULL);
FReport->EngineOptions->SilentMode = True;
FReport->EngineOptions->EnableThreadSafe = True;
FReport->EngineOptions->UseFileCache = false;
FReport->EngineOptions->DestroyForms = false;
FReport->EngineOptions->UseGlobalDataSetList = False;
FReport->ShowProgress = False;
TfrxPDFExport *PDF=new TfrxPDFExport(NULL);
PDF->FileName=MaSession->NomFichierExcel;
PDF->ShowDialog = False;
PDF->ShowProgress = False;
TfrxDBDataset *frxDBDataset2=new TfrxDBDataset(NULL);
frxDBDataset2->DataSet=MaSession->ModuleProduits->RetraitLieu;
int i=frxDBDataset2->DataSet->RecordCount; //One record got Ok!
FReport->EnabledDataSets->Add(frxDBDataset2);
if(FileExists(s+"retrait.fr3"))
FReport->LoadFromFile(s+"retrait.fr3");
if(FReport->PrepareReport())
FReport->Export(PDF);
delete FReport;
delete frxDBDataset2;
delete PDF;
This code is set in the Execute() procedure of a specific thread.
The problem is that PrepareReport returns false.
I couldn't get informations for this case.
Can anyone help me?
Thanks.