This sample shows using a custom control, RichTextBox, to preview RTF directly in Page/RDL reports without need for conversion to HTML.
Just drag and drop the RichTextBox control to the design area, press F2 or Enter or double click the control to enable edit mode, and input the RTF.
TestDesignerPro
TestViewer
Sample Location
Visual Basic.NET
<User Folder>\Documents\GrapeCity Samples\ActiveReports 13\Advanced\PageAndRDL\RtfControl\VB.NET
C#
<User Folder>
\Documents\GrapeCity Samples\ActiveReports 13\Advanced\PageAndRDL\RtfControl\C#
Details
To run the sample, set TestViewer or TestDesignerPro as startup project.
- TestDesignerPro: This is the default startup project. On running this project, an RDL report with RichTextBox is displayed on the designer. You can change its properties from the Properties pane or use the control available on the toolbox.
- TestViewer: On running this project, an RichTextBox is rendered in the Windows Forms Viewer.
Note that this sample is implemented based on WinForms RichTextBox control that provides display features similar to WordPad RTF, such as:
- Images
- Color text and background
- Font size and styles
- Text alignment
- Standard commands like copy/paste and undo/redo
The following hotkeys and shortcuts are supported in edit mode:
- Ctrl + A: Select all content
- Ctrl + C: Copy selected content
- Ctrl + X: Cut selected content
- Ctrl + V: Paste content from clipboard
- Ctrl + B: Toggle bold style of selected text
- Ctrl + I: Toggle italic style of selected text
- Ctrl + U: Toggle underline style of selected text
- Ctrl + T: Toggle strikeout style of selected text
- Ctrl + Z: Undo
- Ctrl + Shift + Z or Ctrl + Y: Redo
- Ctrl + Backspace: Delete the word left to the cursor
- Ctrl + Delete: Delete the word right to the cursor
- Escape: Exit edit mode without saving changes
- Alt + Enter: Exit edit mode with saving changes