0
votes

We have an existing application that allows exporting of an Infragistics data grid to either Excel or PDF format. Currently, when the user clicks on the Export button, it asks them where to save the file and then it exports it and saves it. Then, to launch it, they go to where they saved it and then it launches.

The user wants the application to instead launch the grid into either Adobe Acrobat or Excel and THEN that is where the user can opt to save the file. They don't want it to ask where you wish to save it before it exports, like it currently is doing now.

Is this possible with the Infragistics Document Exporter? I couldn't find any information on this from the Infragistics web site.

I'm thinking, instead of giving it a filename, I could instead use a stream maybe to the console or something like that and let the OS give the user the option to launch it?

Is there an example somewhere of this being done? I see there is an overload in the Export member function that allows you to pass in a stream.

Thanks!.

1
Why you ask the users about the save location?. If you need to keep the file then prepare a predefined folder with some kind on configuration and decide about the filename. Save and open. If you don't need to keep the file then choose a temporary folder and arbitrary name and open from there. - Steve

1 Answers

1
votes

The Infragistics excel engine and documents engine will need to write to a file to be able to have the file opened in Excel or Adobe Acrobat so you will still need to save a file before they can open it.

For the requirement to open the file, you could use System.Diagnostics.Process.Start method and if there is a program associated with the file type you can pass the file that you just saved.

As there is a dependency on the file system to open the file in Excel or Adobe Acrobat you will not be able to achieve your goal of not requiring the file be saved first. While it may be an option to save the file in a temporary location and then open that file it also has an issue that if the user were to click save in excel it would still save in the temporary location so they would need to know to use Save As to save in a different location.