Reporting: Updating a Progress Bar During Merge Processes
According to the golden rules of user experience design, when long-running processes are being executed, it is a good practice to provide feedback to users, for example, updating a progress bar. Merging hundreds of data rows with merge blocks and various merge fields can take some time. TX Text Control's MailMerge component provides events when data rows or block rows are merged, that can be used to perform a step on a progress bar. Consider a master table that contains 50 data rows that…

According to the golden rules of user experience design, when long-running processes are being executed, it is a good practice to provide feedback to users, for example, updating a progress bar.
Merging hundreds of data rows with merge blocks and various merge fields can take some time. TX Text Control's MailMerge component provides events when data rows or block rows are merged, that can be used to perform a step on a progress bar.

Consider a master table that contains 50 data rows that should be merged into your template. The maximum value of the ProgressBar is the number of DataRows in the master table.
DataSet ds = new DataSet();
ds.ReadXml("sample_db.xml", XmlReadMode.ReadSchema);
progress = new frmProgress();
progress.Show();
progress.progressBar1.Maximum = ds.Tables[0].Rows.Count - 1;
progress.progressBar1.Value = 0;
progress.progressBar1.Step = 1;
mailMerge1.Merge(ds.Tables[0]);
progress.Close();
The DataRowMerged event is fired when a data row has been merged successfully. In this event, we simply increase the value of the progress bar by 1.
private void mailMerge1_DataRowMerged(object sender,
TXTextControl.DocumentServer.MailMerge.DataRowMergedEventArgs e)
{
progress.progressBar1.PerformStep();
}
Download this Visual Studio project and try it on your own. A TX Text Control .NET for Windows Forms X10 (20.0) full or trial version is required.
Reporting
The Text Control Reporting Framework combines powerful reporting features with an easy-to-use, MS Word compatible word processor. Users can create documents and templates using ordinary Microsoft Word skills. The Reporting Framework is included in all .NET based TX Text Control products including ASP.NET, Windows Forms and WPF.
Related Posts
Creating Your First ASP.NET Reporting Application
This tutorial shows how to use the MailMerge component in an ASP.NET Web application to merge a template with data to create an Adobe PDF document.
New Online Sample: Build your First Report
We published a new online demo that shows how to create a report including preparing data, creating a template to merging them together.
ReportingDocumentationReportingCloud
Create your First Document with ReportingCloud
As part of our new ReportingCloud documentation, we published a guided tutorial that shows how to create a document without programming.
MailMerge: Starting Each Merge Block on a New Page
A merge block is repeated based on the number of matching data rows in the hierarchical data object. The complete merge block is cloned and inserted under the original location in the template.…
Using MailMerge with JSON Data
In the last article, we explained how to create an ASP.NET Web API to merge templates with JSON data in the payload body of an HTTP request. The focus of this article was on the Web API and…