Exporting report as PDF from service (FMX)

edited July 2017 in FastReport VCL 5
I am trying to write a service that can prepare a report and then export it as a PDF file. I can get this to work from within an FMX application, however I get the following error whenever my service attempts to handle the export:

'Cannot create WIC Imaging Factory for object TCustomBitmapCodecWic'

I am using the following code to prepare and export the report:
frxPDFExport->FileName = MyPath;
frxPDFExport->ShowDialog = false;
frxPDFExport->ShowProgress = false;
frxPDFExport->OverwritePrompt = false;

frxReport->ShowProgress = false;
frxReport->EngineOptions->SilentMode = true;
frxReport->PrepareReport(true);

frxReport->Export( frxPDFExport );

I received the exact same error when calling "PrepareReport" before I turned off the ShowProgress dialog and set "SilentMode" to true. I figured the issue with the report export was also that it was attempting to show some kind of window from the service. However, I have turned off every dialog / show progress property I could find on the pdf report export object and I am still getting the error.

Is there something I am missing here?

Comments

  • gpigpi
    edited 3:52AM
    Attach small demo project with error here

Leave a Comment