Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Cannot Open File

Hello!

On a client this error has occurred

Cannot Open File: "C: \ Users \ Admin | AppData \ Local | Temp | rsp9204.tmp".
Access denied

Sometimes the error goes like this:

Cannot Open File: "C: \ Users \ Admin | AppData \ Local | Temp | rsd4b55.tmp".
The file is already in use by another process.

In either case, the .tmp file is renamed each time.

What can it be ?

This only occurs on the client.

RB version: 19
Delphi: 10.1 Berlin

Print like this:

Report.Template.FileName := rtm directory;
Report.Template.LoadFromFile;
Report.DeviceType := 'Screen';
Report.Print;

I searched at the forum and found these topics, but it didn't work. :(

digital-metaphors.com/forums/discussion/13851/cannot-create-file-error
digital-metaphors.com/forums/discussion/7224/cannot-open-file-access-is-denied/p1

Thanks for the help!!

Comments

  • Hello!

    We are facing a similar issue.

    When using Report.PrintToDevices.

    Device: TppXLSXReportDevice

    ReportBuilder creates tmp-files in AppData. Is it possible to turn off the file writing?

    In TppXMLElementNode.CreateChildStream a TFileStream is used.

    I would like to set a property like CacheToFile to false to use TMemoryStream instead of TFileStream.

    Regards

    Per-Erik Ek
  • I also encounter the issue. I am very confirm this issue is related to AntiVirus program installed on the system. For my case, I have Avast and SAntiVirus installed, uninstall both antivirus application and the problem gone. So far, Windows Defender not causing the error.
Sign In or Register to comment.