PDF export don't work when Intraweb application running as a Windows Service

Hi,

I'm using Delphi 10.2 (Tokio) and Intraweb 15.1.10. I have an application running in a Windows server as a Service, created with default parameters. Recently I've added a new report created with Fast Report 6.5 (last version). When I run the application on my development computer, or I run the app in SA mode, the report shows a preview, and when I export report to PDF, the file is created correctly and the PDF is shown in a new window in browser. But when I run the App as a Windows Service, the file is created empty, and an empty page is shown in browser.

I've changed the directory in which the file is created to C:\Temp, without success. I've changed also the user used to start the service, without success. Here is the source used to create the PDF file:

   RPTOF is the Fast Report Object

   frxPDFExport1 is the Fast Report Export to PDF Filter object.


   RutaInformeOrden   := 'C:\Temp\';

   NombreFicheroPDF  := ChangeFileExt(System.IOUtils.TPath.GetRandomFileName, '.pdf');

  NombreFicheroPDF  := RutaInformeOrden + NombreFicheroPDF;


  frxPDFExport1.FileName    := NombreFicheroPDF;

  frxPDFExport1.DefaultPath  := RutaInformeOrden;

  frxPDFExport1.OpenAfterExport := False;

  frxPDFExport1.ShowDialog   := False;

  RptOF.Export(frxPDFExport1);              <-- Here the file is created, empty when service, full as a SA

  // Open PDF in a new window

  URLFicheroPDF := TIWAppCache.AddFileToCache(Self, NombreFicheroPDF, TIWMimeTypes.GetAsString(mtPDF), ctOneTime);

  WebApplication.NewWindow(URLFicheroPDF);



Could you please help me with this problem?


KR,


               Venancio Lasquíbar

Comments

  • Hi

    Update.

    Using same code, - and a different Delphi project, new ServerController and new UserSession, both with same content - I deployed application in a IIS server. If I place the .fr3 report file in a subdirectory of the root application directory (where the .DLL file is placed) and point the report directory to that subdirectory, the report is shown empty. However, if I place the report in same directory than the DLL and point the report directory to that subdirectory, the report works fine.

    Subdirectory permissions are the default.

    I would like to place my report in a subdirectory. Any idea?

    Could this behaviour be a clue for my original problem?


    Best regards,


                 Venancio Lasquíbar

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.