1 Answer, 1 is accepted

Hello Tim,
Have you check the HTML TextBox Item? This item is used for rendering rich text data. You can find additional details here -> https://docs.telerik.com/reporting/report-items/htmltextbox/overview
If if works our of the box, that's great. Otherwise, you may need to pay attention to how you encode the data or if there are any symbols to be escaped when providing the data for the HTML textbox item.
Regards,
Krasimir Baylov
Hi Krasmir
I've tried both a Text Box and an HTML Text Box. Here is a sample of how the rich text looks in the HTML Text Box
How do I encode the data and escape symbols (as in the first report line)?
Thanks
Tim.
==
Hello Tim,
Attached, you can see a very simple example of using rich text box. A common challenge in many cases is the HTML encoding. It would be nice to store the rich text data in HTML encoded format in your backend system. Or you should make sure that special HTML symbols are escaped.
So, the following HTML:
<p>* using rich text box</p><p>* using special symbols like ' & ;</p><p>end</p>
Should be escaped as:
<p>* using rich text box</p><p>* using special symbols like ' & ;</p><p>end</p>
Also, it's worth considering the HTML encode/decode functions, too.
If none of these hints help, please provide a sample report or some subset of the data that feeds the report.
Regards,
Krasi
Hi Krasi
Tried all of those and couldn't get it to work. Here is a SQL Server script that will create a small table (with 7 rows of data). The column 'EntryText' is the RTF column that I want to output into a report along with the other columns.
Thanks
Tim
=====================
GO
/****** Object: Table [dbo].[RTF_Sample] Script Date: 16/04/2025 15:39:22 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[RTF_Sample](
[LogbookName] [nvarchar](255) NOT NULL,
[Name] [nvarchar](255) NOT NULL,
[EntryText] [nvarchar](max) NOT NULL,
[EntryDateTime] [datetime2](7) NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
INSERT [dbo].[RTF_Sample] ([LogbookName], [Name], [EntryText], [EntryDateTime]) VALUES (N'Shift Log Power ', N'Day Shift', N'{\rtf1\ansi\ansicpg1252\uc1\htmautsp\deff2{\fonttbl{\f0\fcharset0 Times New Roman;}{\f2\fcharset0 Arial;}}{\colortbl\red0\green0\blue0;\red255\green255\blue255;}\loch\hich\dbch\pard\plain\ltrpar\itap0{\lang1033\fs20\f2\b\i\cf0 \cf0\ql{\f2 {\ltrch 7:00 UNIT ON T/G OPERATION.}\li0\ri0\sa0\sb0\fi0\ql\par}
{\f2 {\ltrch 18:02 EDL TO START.}\li0\ri0\sa0\sb0\fi0\ql\par}
{\f2 {\ltrch 18:20 GCB CLOSED.}\li0\ri0\sa0\sb0\fi0\ql\par}
}
}', CAST(N'2025-01-02T17:08:03.5145756' AS DateTime2))
GO
INSERT [dbo].[RTF_Sample] ([LogbookName], [Name], [EntryText], [EntryDateTime]) VALUES (N'Shift Log Power ', N'Day Shift', N'{\rtf1\ansi\ansicpg1252\uc1\htmautsp\deff2{\fonttbl{\f0\fcharset0 Times New Roman;}{\f2\fcharset0 Arial;}}{\colortbl\red0\green0\blue0;\red255\green255\blue255;}\loch\hich\dbch\pard\plain\ltrpar\itap0{\lang1033\fs20\f2\b\i\cf0 \cf0\ql{\f2 {\ltrch 7:00 SEA WATER INTAKE FOUND NORMAL.}\li0\ri0\sa0\sb0\fi0\ql\par}
{\f2 {\ltrch RBS # 3 ISOLATED FOR PTW.}\li0\ri0\sa0\sb0\fi0\ql\par}
}
}', CAST(N'2025-01-02T17:17:57.1692184' AS DateTime2))
GO
INSERT [dbo].[RTF_Sample] ([LogbookName], [Name], [EntryText], [EntryDateTime]) VALUES (N'Shift Log Power ', N'Day Shift', N'{\rtf1\ansi\ansicpg1252\uc1\htmautsp\deff2{\fonttbl{\f0\fcharset0 Times New Roman;}{\f2\fcharset0 Arial;}}{\colortbl\red0\green0\blue0;\red255\green255\blue255;}\loch\hich\dbch\pard\plain\ltrpar\itap0{\lang1033\fs20\f2\b\i\cf0 \cf0\ql{\f2 {\ltrch 7:09 EDL TO STOP }\li0\ri0\sa0\sb0\fi0\ql\par}
{\f2 {\ltrch 7:15 GCB OPENED.}\li0\ri0\sa0\sb0\fi0\ql\par}
{\f2 {\ltrch 7:25 T/G ENGAGED.}\li0\ri0\sa0\sb0\fi0\ql\par}
{\f2 {\ltrch 10:17 EDL TO START.}\li0\ri0\sa0\sb0\fi0\ql\par}
{\f2 {\ltrch 10:35 UNIT GCB CLOSED.}\li0\ri0\sa0\sb0\fi0\ql\par}
{\f2 {\ltrch 13:49 EDL TO STOP.}\li0\ri0\sa0\sb0\fi0\ql\par}
{\f2 {\ltrch 13:59 GCB OPENED.}\li0\ri0\sa0\sb0\fi0\ql\par}
{\f2 {\ltrch 14:10 T/G ENGAGED.}\li0\ri0\sa0\sb0\fi0\ql\par}
}
}', CAST(N'2025-01-02T17:18:50.8478076' AS DateTime2))
GO
INSERT [dbo].[RTF_Sample] ([LogbookName], [Name], [EntryText], [EntryDateTime]) VALUES (N'Shift Log Power ', N'Day Shift', N'{\rtf1\ansi\ansicpg1252\uc1\htmautsp\deff2{\fonttbl{\f0\fcharset0 Times New Roman;}{\f2\fcharset0 Arial;}}{\colortbl\red0\green0\blue0;\red255\green255\blue255;}\loch\hich\dbch\pard\plain\ltrpar\itap0{\lang1033\fs20\f2\b\i\cf0 \cf0\ql{\f2 {\ltrch 7:00 UNIT ON T/G OPERATION.}\li0\ri0\sa0\sb0\fi0\ql\par}
{\f2 {\ltrch 11:37 EDL TO START.}\li0\ri0\sa0\sb0\fi0\ql\par}
{\f2 {\ltrch 11:39 STARTED.}\li0\ri0\sa0\sb0\fi0\ql\par}
{\f2 {\ltrch 11:57 GCB CLOSED.}\li0\ri0\sa0\sb0\fi0\ql\par}
{\f2 {\ltrch RDS SKID OIL LEAKAGE REPORTED, ALREADY SHOWN TO MMD AND WR RAISED TO PRIORITY 2. }\li0\ri0\sa0\sb0\fi0\ql\par}
{\f2 {\ltrch LP BLOW OFF MOV IMD TRIED TO RECTIFY BUT STILL PENDING. }\li0\ri0\sa0\sb0\fi0\ql\par}
}
}', CAST(N'2025-01-02T17:09:16.7798077' AS DateTime2))
GO
INSERT [dbo].[RTF_Sample] ([LogbookName], [Name], [EntryText], [EntryDateTime]) VALUES (N'Shift Log Power ', N'Day Shift', N'{\rtf1\ansi\ansicpg1252\uc1\htmautsp\deff2{\fonttbl{\f0\fcharset0 Times New Roman;}{\f2\fcharset0 Arial;}}{\colortbl\red0\green0\blue0;\red255\green255\blue255;}\loch\hich\dbch\pard\plain\ltrpar\itap0{\lang1033\fs20\f2\b\i\cf0 \cf0\ql{\f2 {\ltrch 7:00 UNIT ON T/G OPERATION.}\li0\ri0\sa0\sb0\fi0\ql\par}
}
}', CAST(N'2025-01-02T17:14:39.4509789' AS DateTime2))
GO
INSERT [dbo].[RTF_Sample] ([LogbookName], [Name], [EntryText], [EntryDateTime]) VALUES (N'Shift Log Power ', N'Day Shift', N'{\rtf1\ansi\ansicpg1252\uc1\htmautsp\deff2{\fonttbl{\f0\fcharset0 Times New Roman;}{\f2\fcharset0 Arial;}}{\colortbl\red0\green0\blue0;\red255\green255\blue255;}\loch\hich\dbch\pard\plain\ltrpar\itap0{\lang1033\fs20\f2\b\i\cf0 \cf0\ql{\f2 {\ltrch 7:00 UNIT ON T/G OPERATION.}\li0\ri0\sa0\sb0\fi0\ql\par}
{\f2 {\ltrch MCWP 2B STOPPED AS PER INSTRUCTION FROM THE MORNING MEETING.}\li0\ri0\sa0\sb0\fi0\ql\par}
}
}', CAST(N'2025-01-02T17:16:49.9199044' AS DateTime2))
GO
INSERT [dbo].[RTF_Sample] ([LogbookName], [Name], [EntryText], [EntryDateTime]) VALUES (N'Shift Log Power ', N'Day Shift', N'{\rtf1\ansi\ansicpg1252\uc1\htmautsp\deff2{\fonttbl{\f0\fcharset0 Times New Roman;}{\f2\fcharset0 Arial;}}{\colortbl\red0\green0\blue0;\red255\green255\blue255;}\loch\hich\dbch\pard\plain\ltrpar\itap0{\lang1033\fs20\f2\b\i\cf0 \cf0\ql{\f2 {\ltrch 7:00 UNIT ON T/G OPERATION. }\li0\ri0\sa0\sb0\fi0\ql\par}
{\f2 {\ltrch HRSG FOR DRY PRESERVATION DRAINS AND VENTS KEPT OPEN.}\li0\ri0\sa0\sb0\fi0\ql\par}
{\f2 {\ltrch }\li0\ri0\sa0\sb0\fi0\ql\par}
}
}', CAST(N'2025-01-02T17:11:14.4402157' AS DateTime2))
GO
=====================
Now I get it. You use RTF format. At this point (to my best knowledge) Telerik Reporting does not provide full support for RTF. You could visualize rich text in reports using the HTML text box. However, the content should be HTML. To achieve this, you would need to convert the RTF content to HTML. That should be relatively easy with some general tools or Telerik Document Processing.
Here is a link on this topic -> https://feedback.telerik.com/reporting/1356873-rtf-text-box
Do you think it's OK to write the rich text context in HTML? You could also consider writing a custom user function that does the conversion and use it in the reports but storing the HTML data in the DB may be much easier to support.
Regards,
Krasi
Hi Krasi
Thanks for getting back to me.
I'll talk to our developers about converting RTF to HTML at our end and see how that works out.
Thanks
Tim.
==