private void ShowPrintPreview()
        {
            TextPrinter textPrinter = this._textPrinter;

            textPrinter.Title           = this.Text;
            textPrinter.ShowPageNumbers = true;
            textPrinter.TextToPrint     = this.txtViewer.Text;
            textPrinter.Font            = this.txtViewer.Font;
            textPrinter.ShowPrintPreview();
            textPrinter = null;
        }
        private void PrintReport(bool showPrintDialog)
        {
            TextPrinter textPrinter = this._textPrinter;

            textPrinter.Title           = this.Text;
            textPrinter.ShowPageNumbers = true;
            textPrinter.TextToPrint     = this.txtViewer.Text;
            textPrinter.Font            = this.txtViewer.Font;
            if (showPrintDialog)
            {
                textPrinter.ShowPrintDialog();
            }
            else
            {
                textPrinter.Print();
            }
            textPrinter = null;
        }