Text justification problem

1 Answer 117 Views
General Discussions
Elena
Top achievements
Rank 1
Elena asked on 17 Nov 2022, 10:41 AM | edited on 21 Nov 2022, 06:11 AM

Hello.
I faced several problems with the attribute "text-align: justify".
1) In the report I have a table that displays some note. This note is retrieved from the database as a string with html-markup (with all necessary tags and its different attributes). All properties of the attribute "Style" work as expected except "text-align: justify". As a result in HTML-viewer I have the note (s.attached overwritten1.png). The text somehow is overlapped/owerwritten. In PDF it looks good though (s.attached overwritten1_PDF.png). In the Sdandalone Report Designer (Preview mode) it works correctly. Unfortunately I can't reproduce the issue with demo example and CSV datasource, but when the report runs and retrieves justified note from the database the issue occurs each time.

2) Another problem is with justifying of the bold-text (s.attached bold.png): I tried to reproduce it in the example (s.attached zip-archive).
When the text has bold font-weight (using <strong>-tag) it is not justified even in Designer (Preview mode).  In PDF it is also absolutely incorrect: with left-alignment text doesn't match the table size at all, with justify-alignment  -  text is overlapped and overwritten

3) I have the report title: bold (s.attached bold.png), text-align: center
In both in HTML-viewer and PDF the title is cut. Without bold font-weight it is wrapped correctly. But I can't remove it. I need this formatting.

Looking forward to your help in these matters. 

Best regards,
Elena

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 22 Nov 2022, 08:27 AM

Hi Elena,

Thank you for the attached files!

Regarding the first issue present only in the HTML5 report viewer, here we try to render the report in HTML interactive view, by default. Since this issue is not present when exported in PDF, you may set the report viewer to display the reports in Print Preview view mode which will have the reporting engine attempt to render the report as closely as possible to how it would look when exported to PDF - Interactive vs. Print Layout - Telerik Reporting.

For setting up the view mode during the initialization of the report viewer, you may see the Report Viewer Initialization - Telerik Reporting article.

Regarding the other two issues, I was not able to reproduce those problems on my machine which uses Windows 10. By any chance, was the PDF from the  bold.png image rendered in a Linux environment?  On Linux, we use the libgdiplus library which is a Mono implementation of GDI+ API for non-Windows operating systems. Since the libgdiplus library is not a perfect replacement for the Windows graphics library, the rendered reports may differ in terms of text positioning, word wrapping, and aligning. 

As a workaround, you may try to render the HTML as an image that is then displayed with the PictureBox item - Display, unsupported by the HtmlTextBox, HTML and CSS content in your reports. - Telerik Reporting.

Hopefully, with this workaround, the text should look correct even under Linux.

Regards,
Dimitar
Progress Telerik

Brand new Telerik Reporting course in Virtual Classroom - the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products. Check it out at https://learn.telerik.com/.
Markus
Top achievements
Rank 1
commented on 22 Nov 2022, 04:34 PM | edited

.

Elena
Top achievements
Rank 1
commented on 22 Nov 2022, 04:36 PM

 

Hello Dimitar,

Thank you for your response. Yes, you are right: the report is rendered in a Linux environment. This might cause the issue. Will try your approach.

Big thanks.

Regards,
Elena

Tags
General Discussions
Asked by
Elena
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or