Export Document Without Progress Bar

Stimulsoft Reports.WPF discussion
Post Reply
david.tom
Posts: 2
Joined: Mon Aug 29, 2011 11:02 am

Export Document Without Progress Bar

Post by david.tom »

Hi,

I'd like to be able to control the visibility of the progress bar during Export like how RenderWithWpf can using a showProgress bool parameter. Is this functionality perhaps hidden somewhere else? Perhaps it should be made to be standard across the various parts of the report engine? Thanks.

Regards,
David
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Export Document Without Progress Bar

Post by HighAley »

Hello, David.[quote="david".tom]I'd like to be able to control the visibility of the progress bar during Export like how RenderWithWpf can using a showProgress bool parameter. Is this functionality perhaps hidden somewhere else? Perhaps it should be made to be standard across the various parts of the report engine? [/quote]
Here is the code for exporting report:

Code: Select all

            bool useExportSettingsMenu = false;
            bool useProgress = true;

            StiReport rep = new StiReport();
            rep.Load(@"d:\test.mrt");
            rep.RenderWithWpf(false);

            FileStream fs = new FileStream(@"d:\test1.xlsx", FileMode.Create);

            if (useExportSettingsMenu)
            {
                rep.ExportDocument(StiExportFormat.Excel2007, fs);
            }
            else
            {
                StiExcel2007ExportService service = new StiExcel2007ExportService();
                StiExcel2007ExportSettings exportSettings = new StiExcel2007ExportSettings();
                if (useProgress)
                {
                    service.Progress = StiGuiOptions.GetProgressInformation(service.OwnerWindow, StiGuiMode.Wpf);
                    service.Progress.Start(StiLocalization.Get("Export", "ExportingReport"));
                    service.ExportExcel(rep, fs, exportSettings);
                    service.Progress.Close();
                    service.Progress = null;
                }
                else
                {
                    service.ExportExcel(rep, fs, exportSettings);
                }
            }
Thank you.
Post Reply