Render and print HTML content using ReportBuilder

General TRichView support forum. Please post your questions here
Post Reply
ricardobh
Posts: 4
Joined: Wed Jun 26, 2024 4:04 pm

Render and print HTML content using ReportBuilder

Post by ricardobh »

Hi,
I need to render and print simple HTML content from a Mariab Text field using ReportBuilder 22.0, Zeoslib 7.2.14 and Delphi 11.3.
I tried to put the Advanced DBRichText component in report deginer but all I get is the raw HTML code, not the rendered one.
What do I need to do?

P.S. We are using your last demo version because we are trying different products in order to decide wich one we'll use in our company.

Thank you,

Ricardo.
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Render and print HTML content using ReportBuilder

Post by Sergey Tkachenko »

Probably, TRichView does not recognize the document content as HTML, so it loads it as a plain text.
Currently, TRichView detects HTML by the presence of "<html" or "<head" withing the initial 1024 characters of the document.
Do you documents have these substrings?
And are they in lower case?
The current version of TRichView has a bug in HTML detection in Unicode (UTF-16) encoding (and this is the encoding that usually ReportBuilder provides): it recognizes HTML only if "<html" or "<head" are written in lower case.
It will be fixed in the next update.
ricardobh
Posts: 4
Joined: Wed Jun 26, 2024 4:04 pm

Re: Render and print HTML content using ReportBuilder

Post by ricardobh »

Thank you for your answer. I've turned the original <HTML> into <html> and it worked.
Another question: How to change the font size? The Advanced DBRichText component is not taking the font size set in report designer.
example:
<html>
<head></HEAD>
<BODY>
<P><EM>Animals</EM> are <B>incredible</B>. Este é um teste de
parágrafo.</P>
<P>Este é outro <U>parágrafo</U>.</P>
<P>&nbsp;</P>
<P>Fim do documento.</P>
</BODY></HTML>
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Render and print HTML content using ReportBuilder

Post by Sergey Tkachenko »

If font size is not defined in HTML, default settings are used.
They are in RVDefaultLoadProperties global variable.
Change DefaultFontSizeDouble property.
The default value is 24 meaning 12pt.
ricardobh
Posts: 4
Joined: Wed Jun 26, 2024 4:04 pm

Re: Render and print HTML content using ReportBuilder

Post by ricardobh »

Thank you. Just two more questions to help me decide on the purchase.
1) Is it possible to make the \r\n become a <br> on the end of the line? Just to make our text cleaner? Or do I need to make some OnBeforePrint replace?

2) On report print preview there's a little red thing before the html rendering, as shown in atachment below. It is because of trial version?
Is it because trial version?
Is it because trial version?
red_thing.png (7.96 KiB) Viewed 44225 times
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Render and print HTML content using ReportBuilder

Post by Sergey Tkachenko »

1) Sorry, no, there is no option to treat line breaks in HTML code as line breaks in a final document. You should replace them to <br>

2) I never tested ReportBuilder with the trial version of TRichView, but i really looks like "unregistered" text written with a small font
(because ppRichView renders content using very large fonts, and displays it scaled down)
ricardobh
Posts: 4
Joined: Wed Jun 26, 2024 4:04 pm

Re: Render and print HTML content using ReportBuilder

Post by ricardobh »

Ok. Thank you.
Now about the purchase of your product: In order to get the integration with report builder, just like we did in with trial version, only TRichView is enough? We need license for 2-3 developers.

Regards,
Ricardo.
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Render and print HTML content using ReportBuilder

Post by Sergey Tkachenko »

Yes, only TRichView is enough.
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Render and print HTML content using ReportBuilder

Post by Sergey Tkachenko »

The problem with uppercase UTF-16 HTML detection is fixed in TRichView 22.4
Post Reply