cancel
Showing results for 
Search instead for 
Did you mean: 

Image not displayed in HTML-interpreted formula

patrick_simons2
Participant
0 Kudos

Take the following HTML-Code of the formula with a small image:

"<?xml version=""1.0"" ?>" +

"<html xmlns=""http://www.w3.org/1999/xhtml"">" +

"<head>" +

"<title>Test Code</title>" +

"</head>" +

"<body style=""font-family:'Arial';font-size:12pt;text-align:left;"">" +

"<p style=""margin-top:0pt;margin-bottom:0pt;""><span style=""color:#000000;"">Before</span></p>" +

"<p style=""margin-top:0pt;margin-bottom:0pt;""><span style=""color:#000000;""> </span></p>" +

"<p style=""margin-top:0pt;margin-bottom:0pt;""><span style=""color:#000000;""><img src=""data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAA8UlEQVQokY2SPRICIQyFX9SD6B1gW2j1UszeQW9hqbZgKXgID2Bry7NgXXfdn/FNimTmexBChCRa3e+4XJp8u4XWGIpFKbGuc1URKJG1Zl0zRvaFQnfRbmStfzxgCFP01xNCa1ggBIlxpNePJCV435ZLJyKPx4wBAEVks8F6DWAl3sMYGDOJX68SAk8nKQwB7vec0eFAgM6VagUAxyOez8kbQgDA10tKma2dGVETxtD7Zkpi7fyLAcBafLAFjOHoCrQjUgrdQ0kyxqz1+K8pxdttsBokY6RzXVtWis790CSlt60p4Xxu8t0OVTXssG/4Q28/Sw0fIqPqfAAAAABJRU5ErkJggg=="" width=""16"" height=""16"" style=""position:relative;float:left;border:0pt none;z-index:1001;"" title=""embedded image (png)"" alt=""[image]"" /> </span></p>" +

"<p style=""margin-top:0pt;margin-bottom:0pt;""><span style=""color:#000000;""> </span></p>" +

"<p style=""margin-top:0pt;margin-bottom:0pt;""><span style=""color:#000000;""> </span></p>" +

"<p style=""margin-top:0pt;margin-bottom:0pt;""><span style=""color:#000000;"">After</span></p>" +

"</body>" +

"</html>"

The text interpretation of the formula is set to HTML. The Preview will show:

Before

After

But the image isn't shown.

I tried it with CR 2008 and CR2011 without success. Same behavior when inserting an image into RTF-Code.

Any ideas,

Patrick

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

Here is a copy of another KB that for some reason is not coming up here on SCN:

1217084 - What are the supported HTML tags and attributes with HTML Text Interpretation?

Symptom

What are the supported HTML tags and attributes when formatting an object to use HTML Text Interpretation in Crystal Reports?

 

Environment

  • Crystal Reports 9 
  • Crystal Reports 10 
  • Crystal Reports XI 
  • Crystal Reports XI R2 
  • Crystal Reports 2008 
  • Crystal Reports 2011

  Resolution 

HTML Text Interpretation formatting option supports HTML tags for text formatting only. 
The supported HTML tags are:
html
body
div (causes a paragraph break)
tr (causes only a paragraph break; does not preserve column structure of a table)
span
font
p (causes a paragraph break)
br (causes a paragraph break)
h1 (causes a paragraph break, makes the font bold & twice default size)
h2 (causes a paragraph break, makes the font bold & 1.5 times default size)
h3 (causes a paragraph break, makes the font bold & 9/8 default size)
h4 (causes a paragraph break, makes the font bold)
h5 (causes a paragraph break, makes the font bold & 5/6 default size)
h6 (causes a paragraph break, makes the font bold & 5/8 default size)
center
big (increases font size by 2 points)
small (decreases font size by 2 points if it's 8 points or larger)
b
i
s
strike
u
The supported HTML attributes are:
align
face
size
color
style
font-family
font-size
font-style
font-weight

In Crystal Reports 2008 Service Pack 2 and above, the following additional HTML tags and attributes have been added to the supported list:
The supported HTML tags are:
ul  ( bulleted list )
ol  ( ordered list )
li   ( tag defining a list item used for both list type: ul and ol. )
Important Note: The bullet will not show up as a regular size bullet, but as a small dot.

The supported HTML attributes are:
strong ( bold )

- Ludek

patrick_simons2
Participant
0 Kudos

As the HTML-Text (or RTF-Text) comes out from a MS SQL-field, how could I print out text with an image inside?

That should be possible in some way....

Patrick

abhilash_kumar
Active Contributor
0 Kudos

Hi Patrick,

Images are supposed to be inserted as separate objects in CR. A field with text that also contains images cannot be used.

If the image is present in the database, why don't you simply use that field in the report instead?

If it is stored at a network location, you can use an OLE object and point it to that network location (using the Graphic Location formula that is).

- Abhilash

Follow us on Twitter

Got Enhancement ideas? Try the SAP Idea Place

Share Your Knowledge in SCN Topic Spaces

patrick_simons2
Participant
0 Kudos

Thanks Abhilash,

The problem is that the Enduser can edit his text and can insert pictures in the text like editing a MS Word document. The result is saved in a SQL DB - RTF or HTML.

So for me it seems to be a lack of functionality in CR.

Should this idea be worth to post at the CR idea place?

Patrick

abhilash_kumar
Active Contributor
0 Kudos

Hi Patrick,

Well, any idea that has the potential to make the product more usable and adds value/functionality is worth posting at the Ideas Place.

Please log this as an Enhancement Request at http://ideas.sap.com

- Abhilash

Follow us on Twitter

Got Enhancement ideas? Try the SAP Idea Place

Share Your Knowledge in SCN Topic Spaces

Answers (3)

Answers (3)

zsolt_lengyel
Discoverer
0 Kudos

So shame for Crystal developers..

Thanks for help.

zsolt_lengyel
Discoverer
0 Kudos

Hello, did anybody solved to put image in html code which can be displayed in Crystal reports?

patrick_simons2
Participant
0 Kudos

Unfortunately not.

ido_millet
Active Contributor
0 Kudos

You can create a UFL that takes HTML content and converts it to an image (this means text as well as embedded images all become a single image). The report can then insert that single image.

One of the 3rd-party UFLs listed here: The Crystal Reports&amp;#174; Underground can already do that given a URL. You can develop a similar approach where the input to the function is a SQL query to retrieve the HTML content in the database (instead of a url).

zsolt_lengyel
Discoverer
0 Kudos

Thank you but I think I would have problems with a longer description which does not fit on a page.

I will use templates. One item description will use 3 types of templates e.g.

- one image on left and text on right

- only text

- text on left and image on right

In the Crystal I made a subreport and used 3 details (lines). If I use the first template type then the first line is show. (other lines are hidden).

The picture is with OLE and the text in HTML format.

Until Crystal make a miracle, I will use this method.

ido_millet
Active Contributor
0 Kudos

Here is an image showing the result of using a UFL to on-the-fly convert your HTML to an image and point a Picture object inside the report to that image using the 'Graphic Location' property expression: 2016-09-10_0927 - IdoMillet's library

former_member183750
Active Contributor
0 Kudos

There are limits to what CR can do with HTML. See the following for more details:

1272676 - Not all the standard HTML tags are interpreted in Crystal Reports when using HTML Text Int...

1217413 - Incorrect formatting with HTML paragraph tag in HTML Text Interpretation

For more info, use the search box in the top right corner of this web page.

- Ludek

Follow us on Twitter

Got Enhancement ideas? Try the SAP Idea Place

Share Your Knowledge in SCN Topic Spaces

patrick_simons2
Participant
0 Kudos

When I click your second link, I get

"Your authorization is not sufficent to get this note".

What about RTF-text interpretation? Same reason?

Patrick

abhilash_kumar
Active Contributor
0 Kudos

Hi Patrick,

Well, I'm pretty sure RTF-text interpretation would do the same. You would need to insert that image as an OLE Object and using the Graphic Location formula, you can point it to a location.

- Abhilash

Follow us on Twitter

Got Enhancement ideas? Try the SAP Idea Place

Share Your Knowledge in SCN Topic Spaces