Page 1 of 1

Export Document Without Progress Bar

Posted: Thu Sep 29, 2011 1:00 pm
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

Export Document Without Progress Bar

Posted: Fri Sep 30, 2011 3:04 am
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.