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 6:18PM
    Attach small demo project with error here

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.