Page 1 of 2

how to access the progressbar when export a pdf document?

Posted: Sun Jan 15, 2012 11:20 pm
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.

how to access the progressbar when export a pdf document?

Posted: Tue Jan 17, 2012 8:09 am
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.

how to access the progressbar when export a pdf document?

Posted: Tue Jan 31, 2012 5:30 am
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);

how to access the progressbar when export a pdf document?

Posted: Wed Feb 01, 2012 9:27 am
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.

how to access the progressbar when export a pdf document?

Posted: Wed Feb 01, 2012 10:43 pm
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;

how to access the progressbar when export a pdf document?

Posted: Thu Feb 02, 2012 4:06 am
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.

how to access the progressbar when export a pdf document?

Posted: Thu Feb 02, 2012 4:40 am
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.

how to access the progressbar when export a pdf document?

Posted: Fri Feb 03, 2012 10:03 am
by HighAley
Hello.

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

Thank you.

how to access the progressbar when export a pdf document?

Posted: Fri Feb 03, 2012 12:19 pm
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.

how to access the progressbar when export a pdf document?

Posted: Mon Feb 06, 2012 3:21 am
by ethanshi
It works, Thanks for replay.