Home General

Error "cannot open file" generating print

Hi all,
i've an installation on remote desktop.
Sometimes generating a report i got a random error:
Can not open file "C:\Users\..\AppData\Local\Temp\2" The process cannot access the file because it is being used by another process.

I've test a couple of times i got this error just with 1 user logged in so this should not be linked to multiple access to same file from other user.
I've olso tryed to search in the component if there's the possibility to change the temp directory but didn't find it.

Let me your thougth.
Thank's
Paola

Comments

  • Same problem here:
    After creating a report file via

    ppReport.DeviceType := dtPDF;
    ppReport.ShowPrintDialog := False;
    ppReport.TextFileName := ;
    ppReport.Print;

    sometimes i get the same error message "cannot open file" afterwards when trying to do further operations with the file. (e.g. attaching to an email.)

    This code worked for years. I assume this problem occoured since v20.x.

    Any ideas how to prevent the problem?

  • Hi Josef,

    The original question in this thread deals with temp files created by the threaded page cache for the report preview. It appears your issue deals with creating a PDF export and then accessing that file.

    We do not have any known issues with the latest version of ReportBuilder and exporting to PDF.

    1. Your code has the TextFileName blank. Is this set elsewhere?
    2. After executing the above code, if you navigate to the exported file manually, does it exist? Are you able to open it?
    3. Any more information about the circumstances of the error and exactly what you are doing with the exported file would be helpful.

    An example of this error would also be helpful. Please send as minimal example to support@ and we'll take a look at what is happening.


    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • Hi Nico,
    1) yes, TextFileName is set to a valid filename. (Did forget this in my example)
    2) yes and yes
    3) this is my code for creating temporary report file(s) manually and afterwards attaching to an email.

    This problem "cannot open file" occurs randomly by some of my customers.
    After rebooting the system, the problem disappears usually.
    Before RB v20.x there was no problem with this code...
    ... maybe there was some change in the RB code creating files in this way?
Sign In or Register to comment.