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.







Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.