Page 1 of 1
Render and print HTML content using ReportBuilder
Posted: Wed Jun 26, 2024 4:19 pm
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.
Re: Render and print HTML content using ReportBuilder
Posted: Wed Jun 26, 2024 8:51 pm
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.
Re: Render and print HTML content using ReportBuilder
Posted: Thu Jun 27, 2024 5:34 pm
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> </P>
<P>Fim do documento.</P>
</BODY></HTML>
Re: Render and print HTML content using ReportBuilder
Posted: Fri Jun 28, 2024 7:52 am
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.
Re: Render and print HTML content using ReportBuilder
Posted: Mon Jul 01, 2024 2:10 pm
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?
- red_thing.png (7.96 KiB) Viewed 43401 times
Re: Render and print HTML content using ReportBuilder
Posted: Mon Jul 01, 2024 5:51 pm
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)
Re: Render and print HTML content using ReportBuilder
Posted: Mon Jul 01, 2024 8:04 pm
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.
Re: Render and print HTML content using ReportBuilder
Posted: Tue Jul 02, 2024 12:27 pm
by Sergey Tkachenko
Yes, only TRichView is enough.
Re: Render and print HTML content using ReportBuilder
Posted: Sat Jul 06, 2024 7:59 pm
by Sergey Tkachenko
The problem with uppercase UTF-16 HTML detection is fixed in TRichView 22.4