cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Reports: RTF - Rich Edit-Version >= 3 - Font Binding

pepe1
Discoverer
0 Kudos
449

Hi,

we switched from old RTF Standard to Version 4.1

Since Version 3 Font Binding is a feature of it. If I place a special sign, like smaller than, the rich edit control choose the best font type for it.

So my rtf code can look like this:

{\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang1031{\fonttbl{\f0\fnil\fcharset0 Arial;}{\f1\fnil\fcharset1 Cambria Math;}}
{\*\generator Riched20 10.0.22621}{\*\mmathPr\mmathFont1\mwrapIndent1440 }\viewkind4\uc1 
\pard\ri10\fs20\par
ABC  \par
10\f1\u8804?\f0\lang1031 20  \par
DEF\par
GHI\par
\par
}

The Result in Crystal looks like this:

It looks like, there is a new Paragraph. But there should be no.

I can open this RTF Code in RTF Controls and it looks correct, but if I open this in Controls with old rich edit Versions, it looks like Crystal Reports shows us.

So what can we do? I cannot find any options in my Reports to set this up correct.

Accepted Solutions (0)

Answers (4)

Answers (4)

DonWilliams
Active Contributor
0 Kudos

Hi Kay,

For backward compatibility CR can't simply upgrade to newer versions of third party dependencies, that could break millions of reports by users who to use the old format or the may have work arounds such as what Jamie suggested.

If you want to request an upgrade go here:

https://www.sap.com/about/customer-involvement/influence-adopt.html

The more people who request it the better the chance it will get implemented.

It appears Jamie found the cause, have the makers of that font fix their issue with vertical spacing.

Don

JWiseman
Active Contributor
0 Kudos

p.s. I think the issue is that when a Text Object encounters that font (and you mentioned there might be others) that it vertically centers the characters in a much larger vertical space reserved for a larger font size. i.e. It's not specifically related to RTF Interpretation.

Have a look at the picture below...this is a pic from 2 Text Objects in Crystal 2020. The one on the left is using Cambria Math. The one on the right is using DejaVu Sans.

Note that there are empty spaces in the left Text Object that have been highlighted. So it appears that the Text Object is not adding an additional paragraph but is using a vertical space for a much larger font. The horizontal space is fine.

I'm not really sure this is a bug or not and unfortunately I don't have access to customer assurance to check. In the meantime, does DejaVu Sans work for your case?

pepe1
Discoverer
0 Kudos

Thanks for your answer. Your analysis is correct.

Others fonts can work, and it could be a workaround, but the problem is: Pasting a char from windows character map into RTF Control, the rtf control replaces the font automaticly. It could be Cambria Math or any other. And I don't know all any other and I am not willing to copy and paste all the other chars from character map to find all other fonts.

In RTF Control it looks correct and nice. When I save it, and open it in an old RTF Control < Version 4.1 it looks similiar to Crystal Report rendered Text. So I stay at my point, that's a bug, because they are using old stuff.

I also don't have access to customer assurance to check.

pepe1
Discoverer
0 Kudos

Hi,

it's a possible way, but not the best. If my customer wants to work with this font, because he want's to write a math formula, it ends in a problem. Also "Cambria Math" is not the only font it get set by the substitution from rtf control.

In my opinion it's a bug and crystal report has to support "modern" rich edit formats. Rich Edit 4.1 was introduced with Windows XP Sp1 or 2. So it's a very long time ago....

JWiseman
Active Contributor
0 Kudos

If you've got a support contract you can always contact customer assurance and check with them to see if this is considered a bug. There's also a customer influence program.

JWiseman
Active Contributor
0 Kudos

Hi Kay, Crystal Reports uses a much older RTF interpretation...basically anything that works in a Text Object I believe should be applicable to RTF interpretation in fields and formulae.

Given that, it looks like the issue is due to using a Math Type font. i.e. If you utilize a different font type than Cambria Math then it would match the paragraph formatting in your 2nd picture.

I'm not sure if this would be a bug or not, but for now the workaround would be to change up the font that is causing the issue. If this RTF code is coming from your database, then you can create a new Formula with code like the following using a (working) font of your choice for the replacement.

replace({your rtf field}, '{\f1\fnil\fcharset1 Cambria Math;}', '{\f1\fnil\fcharset0 Arial;}')