PrintCompleted problem

2 posts, 0 answers
  1. kity
    kity avatar
    71 posts
    Member since:
    Mar 2012

    Posted 20 Sep 2013 Link to this post

    ...


     

    public abstract class ExportProvaiderDocument : RadDocument, IValidatable, IDisposable
    {
      
      public abstract void Export();
        
    }
      
      
      
    public class PrintProvaider : ExportProvaiderDocument
    {
      
      public RadRichTextBox PrintBox = new RadRichTextBox();
      
      public RadRichTextBox PrintBox = new RadRichTextBox();
      
            public override void Export()
            {
                if (this.Validate())
                {
                    try
                    {
                        Print();
                    }
                    catch (System.InvalidOperationException ie)
                    {
                        // There is no DocumentFormatProvider which supports html
                        Telerik.Windows.Documents.FormatProviders.DocumentFormatProvidersManager.RegisterFormatProvider(new HtmlFormatProvider()); // Some Telerik depending
                        Print();
                    }
                }
            }
              
              
            public void Print()
            {
                this.PrintBox.Document = this; // set RadDocument, before that one of my provaider set raddocument. All Provaiders like class "PrintProvaider" inherited ExportProvaiderDocument
      
                var printSettings = new Telerik.Windows.Documents.UI.PrintSettings();
                printSettings.DocumentName = "Print Report";
                printSettings.PrintMode = Telerik.Windows.Documents.UI.PrintMode.Html;
                printSettings.PrintScaling = Telerik.Windows.Documents.UI.PrintScaling.None;
      
                //this.PrintBox.PrintCompleted -= _printEventHandler;
                //_printEventHandler = (s, a) =>
                //{
                //    Wave.Platform.PortalFramework.Infrastructure.MessageBox.WaveMessageBox.Info("Report was successfully printed.");
                //    this.PrintBox.Document = new RadDocument();
                //};
      
                //this.PrintBox.PrintCompleted += _printEventHandler;
      
      
                this.PrintBox.PrintCompleted += PrintBox_PrintCompleted;
                this.PrintBox.Print(printSettings);
            }
      
            void PrintBox_PrintCompleted(object sender, Telerik.Windows.Documents.UI.PrintCompletedEventArgs e)
            {
                Wave.Platform.PortalFramework.Infrastructure.MessageBox.WaveMessageBox.Info("Report was successfully printed.");
            }
              
              
              
              
    }



    Bug description: When I print document via PRINTER machine, event PrintCompleted() never call/enter.
    Check function "PrintBox_PrintCompleted()".

     

    IValidatable is custome interfaice - it is not important
    IDisposable is standart interfaice for free non manage inctance like FileStream (one of my properties in abstract class). Standart implementation.

     

  2. kity
    kity avatar
    71 posts
    Member since:
    Mar 2012

    Posted 20 Sep 2013 Link to this post

    Version: 2013.1.527.1050
  3. DevCraft banner
Back to Top