Click here to Skip to main content
15,884,237 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using an external library on my application that handles report viewing.
On this external library, there is a function to save the report as a PDF that triggers a SaveFileDialog that requires the user to input a file name and save the file.
All good until now, but what I would like to do is set the file name input's text of the dialog then click the save button programmatically, instead of having the user do it every time. Is that possible?

What I have tried:

I have looked around the library's built-in functions to check if there is a function that allows me to export the PDF automatically (without opening dialogs etc.) but there doesn't seem to be any - so I'm having to experiment...
Posted
Updated 14-Sep-22 19:25pm

1 solution

Pretty much, no - you would be better off trying to contact the external library authors and asking them. I mean, with some real fudging it would probably be possible to identify the Save Dialog window and send the appropriate Windows messages to it - but then you are open to changes in the library and / or Windows breaking your app, as well as being a nasty kludge.

Plus ... you may not save the file where the user wants it: not all systems are setup the same way, and the user may not be able to find the output file at all, or the destination you select may not exist, or the file name might be in use for something else really important to the user ...

Without access to the library that's all we can really suggest.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900