Hello,
We are using RichTextBox control for Mail merge functionality to implement in our system. Our requirement is to complete the mail merge and print the entire document.
When the print is completed, we would like to know that the printing job is completed successfully for all pages to perform some insert/update operations in the database. We are using the following code to check the printing job is success, but we are not getting the PrintJobInfoCollection results.
RadDocument _MergedDocument = this.radRichTextBox.MailMerge();
if (_MergedDocument != null)
{
this.radRichTextBox.Document = _MergedDocument;
PrintSettings _PrintSettings = new PrintSettings()
{
DocumentName = "My document",
PrintMode = PrintMode.Native,
PrintScaling = PrintScaling.None
};
PrintDialog _PrintDialog = new PrintDialog();
_PrintDialog.PageRangeSelection = PageRangeSelection.AllPages;
_PrintDialog.UserPageRangeEnabled = true;
Nullable<Boolean> print = _PrintDialog.ShowDialog();
if (print == true)
{
this.radRichTextBox.Print(_PrintDialog, _PrintSettings);
PrintJobInfoCollection jobs = _PrintDialog.PrintQueue.GetPrintJobInfoCollection();
foreach (PrintSystemJobInfo theJob in jobs)
{
if (((theJob.JobStatus & PrintJobStatus.Completed) == PrintJobStatus.Completed) || ((theJob.JobStatus & PrintJobStatus.Printed) == PrintJobStatus.Printed))
{
MessageBox.Show("completed");
}
}
}
}
Thanks