This is a migrated thread and some comments may be shown as answers.

PivotGrid Print Error

4 Answers 21 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
Asuman
Top achievements
Rank 1
Asuman asked on 31 Aug 2015, 06:24 AM

Hi everybody,

I've run yor sample pivotgrid printing project and it's showed up the error below.

What may be the problem?

 Best regards...

4 Answers, 1 is accepted

Sort by
0
Asuman
Top achievements
Rank 1
answered on 31 Aug 2015, 06:44 AM
Sorry for sample sending problem.
I've added the sample link and error snapshot here: http://www.telerik.com/forums/print-and-pdf-export
0
Accepted
Mihail
Telerik team
answered on 02 Sep 2015, 04:00 PM
Hello Asuman,

I can confirm that there is a problem with the printing in this particular case. Fortunately, there is a workaround for this problem. Instead of using RadRichTextBox for printing RadPdfViewer could be used. Attached you can find the solution from the other thread with the required modification.

Regards,
Mihail
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Asuman
Top achievements
Rank 1
answered on 06 Sep 2015, 03:14 PM

Hi Mihail,

Thanks for the solution. It's fixed out my problem for now. However I would be waiting for the solution with radrichtextbo.

 

Best regards...
0
Accepted
Polya
Telerik team
answered on 08 Sep 2015, 08:21 AM
Hi Asuman,

The InvalidOperationException is thrown because the window is closed before the printing had finished. For that reason in the example the window is closed in a Dispatcher. However, when the data to be printed is not minimal the closing still occurs before the printing had finished.
So instead of calling this.Close() in the PrintButton_Click() handler I suggest closing the window when the print operation ends, by adding handler to the RadRichTextBox.PrintCompleted event:
public partial class PrintPreview : RadWindow
{
    PrintDocument pd;
 
    public PrintPreview(RadDocument document)
    {
        InitializeComponent();
 
        this.RichTextBox.Document = document;
        this.RichTextBox.PrintCompleted += RichTextBox_PrintCompleted;
    }
 
    void RichTextBox_PrintCompleted(object sender, PrintCompletedEventArgs e)
    {
        this.Close();
    }
 
    private void PrintButton_Click(object sender, RoutedEventArgs e)
    {
        this.RichTextBox.Print("Test", PrintMode.Native);
    }
 
    private void CancelButton_Click(object sender, RoutedEventArgs e)
    {
        this.Close();
    }
}

Hope this helps and is suitable for your scenario.

Regards,
Polya
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
PivotGrid
Asked by
Asuman
Top achievements
Rank 1
Answers by
Asuman
Top achievements
Rank 1
Mihail
Telerik team
Polya
Telerik team
Share this question
or