Page 1 of 1
How to set Open after export from runtime
Posted: Tue Sep 02, 2014 11:01 am
by LukasT
Hello,
I need to control setting of "Open after export checkbox" from runtime. Please, how to do it?
Re: How to set Open after export from runtime
Posted: Wed Sep 03, 2014 7:18 am
by Alex K.
Hello,
You can use the following code:
Code: Select all
StiSettings.Load();
StiSettings.Set("StiPdfExportSetupForm", "OpenAfterExport", true);
StiSettings.Save();
Thank you.
Re: How to set Open after export from runtime
Posted: Fri Sep 05, 2014 7:20 am
by LukasT
Thank you,
but it is not working...
My code:
StiSettings.Load();
StiSettings.Set("StiPdfExportSetupForm", "OpenAfterExport", true);
StiSettings.Save();
StiExportService serv = new StiPdfExportService();
serv.Export(report, file, Stimulsoft.Base.StiGuiMode.Wpf);
Re: How to set Open after export from runtime
Posted: Fri Sep 05, 2014 11:45 am
by Alex K.
Hello,
Please try to use the following code:
Code: Select all
StiSettings.Load();
StiSettings.Set("StiPdfExportSetupControl", "OpenAfterExport", true);
StiSettings.Save();
Thank you.
Re: How to set Open after export from runtime
Posted: Wed Nov 12, 2014 9:11 am
by LukasT
Hello,
I am sorry but this way how to get value of OpenAfterExport property seems to be not stable

In new release is path to property different and I need to have some reliable solution how to get value of this property for all export types...
Now I am using this way which is correctly working for all export service types except case of Image or Data export service:
bool oldOpenAfterExportValue = (bool)StiSettings.Get("Sti" + service.ExportFormat.ToString() + "ExportSetupControl", "OpenAfterExport", false);
Re: How to set Open after export from runtime
Posted: Thu Nov 13, 2014 7:08 am
by HighAley
Hello.
The
OpenAfterExport is not connected with export service, but with export dialog. So there is
StiDataExportSetupControl but not the StiCsvExportSetupControl, StiDbfExportSetupControl and etc.
The same situation with
StiImageExportSetupControl.
There is a difference between WinForms and WPF products.
In
WinForms there are
StiDataSetupForm and
StiImageSetupForm.
And in the
WPF there are
StiDataGroupExportSetupControl and
StiImageGroupExportSetupControl.
As we see from your code you export reports from code and not from viewer. It this case the OpenAfterExport option doesn't work.
Here is a method that we call to open exported report. You could use the same.
Code: Select all
System.Diagnostics.Process.Start(string.Format("\"{0}\"", fileName));
Thank you.
Re: How to set Open after export from runtime
Posted: Thu Nov 13, 2014 4:35 pm
by LukasT
The right reason why I need access to this property is to set it to false value... I will try StiDataGroupExportSetupControl and StiImageGroupExportSetupControl name...
Re: How to set Open after export from runtime
Posted: Fri Nov 14, 2014 1:08 pm
by HighAley
Hello.
Sorry, maybe we don't exactly understand your message.
Could you describe it more detailed?
Thank you.
Re: How to set Open after export from runtime
Posted: Tue Dec 09, 2014 9:24 am
by LukasT
Never mind.... the StiDataGroupExportSetupControl and StiImageGroupExportSetupControl name is working correctly... thank you.
Re: How to set Open after export from runtime
Posted: Tue Dec 09, 2014 12:51 pm
by HighAley
Hello.
Let us know if you need any additional help.
Thank you.