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

[Solved] Printing a RadDocument without assigning to a RadRichTextBox

3 Answers 542 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
GEB
Top achievements
Rank 1
GEB asked on 17 Sep 2010, 08:06 PM
I am building a RadDocument in code-behind, but don't want to assign it to a RadRichTextBox.  Rather, I want to be able to print the RadDocument.  Any examples are recommendations on how to do this?

3 Answers, 1 is accepted

Sort by
0
Mike
Telerik team
answered on 22 Sep 2010, 01:29 PM
Hello GEB,

Currently the only way available to to print a document is through RadRichTextBox API. In the case with Silverlight printing the rich text box instance should be added to the the application element tree in order for printing to work correctly.

I've prepared you a sample application that demonstrates the possible approach to printing RadDocument using both Silverlight and Html printing.

Regards,
Mike
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
GEB
Top achievements
Rank 1
answered on 23 Sep 2010, 09:20 AM
Mike, thanks for the quick response.  Your example application was exactly what I needed, and I was able to successfully implement the printing feature in my SL4 application.  I have chosen to use Silverlight printing rather than HTML printing.

I do have a follow up question, though.  In my Silverlight application, I am also using the Telerik Report Viewer.  Are there any examples of incorporating a XAML-based document into a report?  In my case, the XAML will be created using RadRichTextBox (similar to the Telerik MS Word editor example), and the resulting XAML will be stored in a SQL Server database.  The Telerik reporting environment, using the SL Viewer, will be used to print reports from the database.  There are some reports where I would like to print the XAML created using RadRichTextBox.  Any help/direction would be appreciated.

If it is more appropriate, I can open a new thread under Telerik Reporting.
0
Ivailo Karamanolev
Telerik team
answered on 23 Sep 2010, 09:28 AM
Hello GEB,

Interoperability with the reporting solution is achieved by the means of HTML. If you store your documents in XAML, you'll need to import them into a RadDocument and export them to HTML before passing them forward to reporting.
The reporting team is currently working on a help article to explain how the HtmlFormatProvider needs to be configured in order to make it work with their HTML parser. However, since this is not ready yet, here's what you need to do in order to make the HTML compatible:
The HtmlFormatProvider has a property named ExportSettings which is of type HtmlExportSettings. You need to create an instance of the settings class and assign the following properties:
  • ImageExportMode = ImageExportMode.None;
  • StylesExportMode = StylesExportMode.Inline;
  • DocumentExportLevel = DocumentExportLevel.Fragment;
Please note that some of these properties are only available in the LIB, so please use that in order to make things work with reporting. Let us know how it goes.

All the best,
Ivailo
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
RichTextBox
Asked by
GEB
Top achievements
Rank 1
Answers by
Mike
Telerik team
GEB
Top achievements
Rank 1
Ivailo Karamanolev
Telerik team
Share this question
or