cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Crystal Reports while interpreting HTML

Former Member
0 Kudos

Hi,

We have an Ajax HTML Editor which is used by admin of our application to input some formatted text. Normal users can print this data in pdf format and  Crystal reports (version: 13.0.2000.0) is used to generate this pdf report. We found out that in the generated report some of the html tags are not interpreted properly. Please find below some of these html tags which are not interpreted:

<span style="font-weight: bold">This should be Bold</span>

<span style="font-style: italic">This should be Italic</span>

<span style="text-decoration: underline">This should be underlined</span>

<br />

Some bullets are also not interpreted.

When we created a sample project, we also found out that once we remove the spacing between the attribute name and value in style tag, it is interpreted fine. Even the tags <b>, <i>, <u> are interpreted properly.

As we dont have any control on the html code generated by the editor, we cannot alter the above <span> and <br> tags to the ones that work fine & we cannot change even the editor at this point of time. So please let us know what needs to be done, for crystal reports to interpret the above listed tags properly. Is this bug fixed in latest versions ?

This is a very crucial functionality in the application and please help us in resolving it at the earliest possible.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Ashok

We are using a Richtext control which stores data in DB in HTML format. Data gets stored correctly, but while rendering in Crystal 2008 sp5 and Im facing couple of issues

1. The bullets look too tiny and there is no space between the bullet and the text

I tried adding &nbsp and a <pre. tag, but crystal strips it off

2. How does the Crystal interpret the span class? Even if I save it with a class that adds say 10px i guess it will remove it. Can you pls help?

Net-net,

1. I need a bigger size bullet the text in HTML is as below

<P>In-venue:</P><BR>

<UL>

<BR><LI>Annual promotional calendar</LI></UL><BR>

<P></P>

2. Space between the bullet and text

Any help is appreciated.

former_member183750
Active Contributor
0 Kudos

How do the bullet points look in the CR designer?

What version of VS are you using?

- Ludek

Former Member
0 Kudos

Thanks Ludek for the reponse.

We dont use either a VS or any of MS tools in our project..

We store data in database (via a java App) and the result gets stored in HTML (as expected from a RichText control).

Sample as below

<P>We are paying $20k for the following rights during the 6 month term beginning 3/1/2010 through 8/30/2010:</P><BR>

<OL>

<LI>Use of Katherine McPhee's name and likeness online, on POS materials, on Domino's packaging and store materials.</LI>

<LI>Use of one of Katherine McPhee's single (specific single to be mutually agreed) online (streaming only, not downloads) and in-stores (including on-hold music) to be fully cleared through her record label.</LI>

<LI>Use of the single's video online.  All rights to be cleared.</LI>

<LI>McPhee to provide stock photography as requested.</LI>

<LI>One 2-hour production day at her then-current location for recording of radio and voice-over materials.</LI>

<LI>One personal appearance day (4 hours) in order to perform the prize winner's pizza delivery.</LI></OL>

-----------------------------

For an unsorted list HTML as below

<UL>

<LI>2 year agreement (2005 and 2006)</LI>

<LI>$200,000 per year</LI>

<LI>$20,000 in VIK/product per year</LI></UL><BR>

<P>TCCC to receive: </P><BR>

<UL>

<LI>identification on team water bottles (1 of 3 sponsors)</LI>

<LI>identification on team vehicles (US and Europe)</LI>

<LI>4 two-hour rider appearances per year (excluding Lance)</LI>

<LI>hospitality packages for 4 for 2005 and 2006 Tour de France</LI></UL><BR>

<P> </P><BR>

The end user creates a report using Crystal by changing the control to read HTML data (Text Interpretation) and views it. Result is as seen above for both sorted and unsorted list. If there is a solution in Crystal by which user can see the bullets legibly (in settings or elsewhere) or a possible work around in the way data is persisted in DB?

Other issue observed

1. The spacing between the bullet/number and the text that follows it is minimal unlike as seen in the HTML.

I tried introducing the span and the <pre> tags...Both are not read by Crystal

Kindly help

former_member183750
Active Contributor
0 Kudos

Well, you attached your self to a post that is in the SAP Crystal Reports, version for Visual Studio SCN Space, not Crystal Reports design Space...

It may be a good idea to post to that Space. One thing I'd like you to check out is the following KBAs re supported HTML tags:

1217084 - What are the supported HTML tags and attributes for the HTML Text Interpretation in Crysta...

One thing to note in the above:

ul  ( bulleted list )  Important Note: The bullet will not show up as a regular size bullet, but as a small dot. 



- Ludek


ido_millet
Active Contributor
0 Kudos

See:

Former Member
0 Kudos

Thanks Ido Millet

Are you saying that CR-2008 does not support formatting of bullets and numbering and the user now has to buy the CUT Light plugin? Does the user need to upgrade to a different version which supports it?

I'm not an expert in CR, but if you can point me how to achieve the solution with 2008 will be greatly appreciated.

Regards

Arun

Former Member
0 Kudos

Ido Millet - The other issue I need help on is with the bullets not being displayed if there is no close </li> element. For ex the below HTML

<P><STRONG><U>MICHELLE KWAN (figure skater):</U></STRONG> </P><BR>

<UL>

<LI>$175,000 fee

<LI>2 personal appearances, <I>two</I> <I>optional appearances AFTER the Games at $25,000 per appearance</I><I>.</I>

<LI>right to use image, likeness on print, POS, etc.

<LI>option for television commercial usage at scale

<LI>nonalcoholic beverage exclusivity except fro Milk (see below) 

<LI>KWAN HAS A MILK DEAL, PRINT ONLY.  This will limit our exclusivity.  She has a "Got Milk" poster/Milk Mustache advertisement , and the Milk Board has rights to use it throughout the proposed term of our agreement. </LI></UL><BR>

<P><STRONG><U>APOLO OHNO (short track speed skater):</U></STRONG></P><BR>

renders as

Since there is no closing </li> for the first 5 elements, the bullets are gone.

Kindly help

Arun

Answers (2)

Answers (2)

former_member183750
Active Contributor
0 Kudos

I moved your post to the SAP Crystal Reports, version for Visual Studio SCN Space.

Make sure you are using SP 12:

If that does not help, please test with SAP Crystal Reports 2013. An Eval is here:

SME Free Trials | SME Software | SAP

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow us on Twitter

ido_millet
Active Contributor
0 Kudos

One option is to use the Replace() function to remove the "bad" spaces.

For example,

Replace(Replace(Replace("font-weight: ", "font-weight:"),""font-style: ", "font-style:"),"text-decoration: ", "text-decoration:")

Former Member
0 Kudos

Hi Ludek,

We are using a Richtext control which stores data in DB in HTML format. Data gets stored correctly, but while rendering in Crystal 2008 sp5 and Im facing couple of issues

1. The bullets look too tiny and there is no space between the bullet and the text

I tried adding &nbsp and a pre, but crystal strips it off

2. How does the Crystal interpret the span class? Even if I save it with a class that adds say 10px i guess it will remove it. Can you pls help?

Any help is appreciated.

abhilash_kumar
Active Contributor
0 Kudos

Hi Ashok,

Not all tags are supported by Crystal Reports.

This SAP Note has the list of supported tags.

-Abhilash

Former Member
0 Kudos

Hi Abhilash,

Thanks for the quick reply.

The above link says span tag  and br tags are supported by Crystal reports, even the attributes

font-style and font-weight are supported.  As mentioned in my last post, i am using these same tags but they are not interpreted by CR. We found this is because of the spacing between attribute name and value in the span tag.

Please find the below screenshot, to see the CR report output. As you can see, the text is not formatted at all and the line break is also not interpreted.

* The attachment in the first post is the sample project output , which is generated by removing spaces between attribute name and value. As we can see CR is interpreting bold and italic. But when there are spaces between attribute name and value, as shown in above screen shot, CR is not all interpreting the HTML tags.

abhilash_kumar
Active Contributor
0 Kudos

Yes, you're right. Removing the spaces seems to fix the issue (I missed that part from your initial post).

I would wait for someone from SAP to comment on this.

-Abhilash