how to access the progressbar when export a pdf document?

Stimulsoft Reports.NET discussion
ethanshi
Posts: 5
Joined: Sun Jan 15, 2012 11:10 pm
Location: China

how to access the progressbar when export a pdf document?

Post by ethanshi »

hi,

When I export a pdf document, there will be a progressbar with a cancel button on the screen.
How can I disable the cancle button, or can i implement a new progressbar without the cancle button?

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

how to access the progressbar when export a pdf document?

Post by HighAley »

Hello.
ethanshi wrote:When I export a pdf document, there will be a progressbar with a cancel button on the screen.
How can I disable the cancle button, or can i implement a new progressbar without the cancle button?
How do you call export? If with code then provide us part of your code.

Thank you.
ethanshi
Posts: 5
Joined: Sun Jan 15, 2012 11:10 pm
Location: China

how to access the progressbar when export a pdf document?

Post by ethanshi »

Aleksey wrote:Hello.
ethanshi wrote:When I export a pdf document, there will be a progressbar with a cancel button on the screen.
How can I disable the cancle button, or can i implement a new progressbar without the cancle button?
How do you call export? If with code then provide us part of your code.

Thank you.

Aleksey:

Thanks for your reply, please help me review the following code:

StiReport report = new StiReport();
DataTable dt_data = ConvertHashToDatatabale(objHashTable);

report.Load(strTemplateFilePath);

dt_data.TableName = "dtContract";

report.RegData(dt_data);relay

/*Gen WaterMark*/
if (IsWaterMark)
{
for (int i = 0; i < report.Pages.Count; i++)
{
report.Pages.Watermark.Enabled = true;
report.Pages.Watermark.Text = "Draft";
}
}
else
{
for (int i = 0; i < report.Pages.Count; i++)
{
report.Pages.Watermark.Enabled = false;
}
}
/*Gen End*/

report.Render(true);
report.ExportDocument(StiExportFormat.Pdf, strOutputFilePath);
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

how to access the progressbar when export a pdf document?

Post by HighAley »

Hello.

Please, try to use next code instead of report.ExportDocument(StiExportFormat.Pdf, strOutputFilePath);

Code: Select all

                StiPdfExportService service = new StiPdfExportService();
                if (useProgress)
                {
                    service.Progress = StiGuiOptions.GetProgressInformation(service.OwnerWindow, StiGuiMode.Gdi);
                    service.Progress.SetAllowClose(false); //disable Cancel button
                    service.Progress.Start(StiLocalization.Get("Export", "ExportingReport"));
                    service.ExportPdf(report, strOutputFilePath);
                    service.Progress.Close();
                    service.Progress = null;
                }
Thank you.
ethanshi
Posts: 5
Joined: Sun Jan 15, 2012 11:10 pm
Location: China

how to access the progressbar when export a pdf document?

Post by ethanshi »

Hi,

Thank you for reply.
I've tried the code provided, but the progressbar is still there.
I find the progressbar appears when the application run to "report.Render(true);". I comment the code and then the pdf is not exported.

Here is my code:

report.Render(true);
//report.ExportDocument(StiExportFormat.Pdf, strOutputFilePath);

StiPdfExportService service = new StiPdfExportService();
service.Progress = StiGuiOptions.GetProgressInformation(service.OwnerWindow, StiGuiMode.Gdi);
service.Progress.SetAllowClose(false); //disable Cancel button
service.Progress.Start(StiLocalization.Get("Export", "ExportingReport"));
service.ExportPdf(report, strOutputFilePath);
service.Progress.Close();
service.Progress = null;
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

how to access the progressbar when export a pdf document?

Post by HighAley »

Hello.
ethanshi wrote:Thank you for reply.
I've tried the code provided, but the progressbar is still there.
I find the progressbar appears when the application run to "report.Render(true);". I comment the code and then the pdf is not exported.
Please use report.Render(false); code.

Thank you.
ethanshi
Posts: 5
Joined: Sun Jan 15, 2012 11:10 pm
Location: China

how to access the progressbar when export a pdf document?

Post by ethanshi »

Aleksey wrote:Hello.
ethanshi wrote:Thank you for reply.
I've tried the code provided, but the progressbar is still there.
I find the progressbar appears when the application run to "report.Render(true);". I comment the code and then the pdf is not exported.
Please use report.Render(false); code.

Thank you.
Hi,
I change to Render(false) and it works.
But the following code still pop up a progressbar.

Thanks for replay.
Attachments
1616.progressbar.jpg
1616.progressbar.jpg (14.66 KiB) Viewed 2096 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

how to access the progressbar when export a pdf document?

Post by HighAley »

Hello.

Sorry for the delay with response. We need some additional time to prepare the answer for you.

Thank you.
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

how to access the progressbar when export a pdf document?

Post by Ivan »

Hello,

Sorry for the mistake. Please modify your code. For export with progressbar:

Code: Select all

                StiPdfExportService service = new StiPdfExportService();
                service.Progress = StiGuiOptions.GetProgressInformation(service.OwnerWindow, StiGuiMode.Gdi);
                service.Progress.Start(StiLocalization.Get("Export", "ExportingReport"));
                service.Progress.SetAllowClose(false); //disable Cancel button
                service.ExportPdf(report, strOutputFilePath);
                service.Progress.Close();
                service.Progress = null;
For export without progressbar:

Code: Select all

                StiPdfExportService service = new StiPdfExportService();
                service.ExportPdf(report, strOutputFilePath);
Thank you.
ethanshi
Posts: 5
Joined: Sun Jan 15, 2012 11:10 pm
Location: China

how to access the progressbar when export a pdf document?

Post by ethanshi »

It works, Thanks for replay.
Post Reply