Skip to Content

Image not displayed in HTML-interpreted formula

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on Sep 27, 2012 at 02:53 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 27, 2012 at 02:46 PM

    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 Intepretation

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 08, 2016 at 09:07 AM

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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 08, 2016 at 11:19 AM

    So shame for Crystal developers..

    Thanks for help.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.