What is the best way to Cancel PDF Export?

PolomintPolomint Australia
edited August 2018 in FastReport VCL
OK situation is this. A User regularly gets exceptions in our App when an attempt is made to Export to PDF a FastReport, caused by another User having an earlier version of the file open.

Their ideal solution is a "friendly" warning the filename is not available with a choice to either cancel, or save it by another name / in another folder.

The two exposed events for TfrxPDFexport look like the place to do it, with a preference for BeginExport (as it follows the two dialogue boxes for PDF properties and save name / location).

Experiments have successfully detected an "in use" file, but so far show no way to Cancel the report.

Any suggestions?

Cheers, Paul

PS we have v6.1.12 installed.

EDIT:

Oh and experiments also show that we can't change the Filename property of TfrxPDFexport in BeginExport - so Cancel is going to be our only option, if we can work out how to do it.

Comments

  • PolomintPolomint Australia
    edited 12:55PM
    OK so no one has an answer to this? I note the post had 36 readers, so there was interest in the question.

    In the absence of any alternative, and for those who might want to do something similar...

    We've opted to raise an Exception, and have found (reading through the FastReport Source) that EExportTerminated class is a "silent" exception which seems to work without negative consequences.

    We've opted to add new code at the end of the common routine that all our reports use for TfrxPDFexport.OnBeginExport. It loops while our FileInUse (FileName) function returns True, and the User has not selected Cancel. On selecting Cancel we raise the silent exception.

    Cheers, Paul
  • edited 12:55PM
    I have used v6.1.12 but it is not working in my HP laptop, I have also consulted with hp Canada support but did not get any solution from here. Kindly provide me the reliable solution.
  • edited August 2019
    I'm also using v6.1.12 and its working properly.


    __________________
    Epson Klantenservice

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.