HTML fields in Crystal Reports

Version 3

    Just a couple of little pointers about crystal and html for you.

     

    Firstly, you may have noticed that if you have a html string field on the main IPC windows the default report will strip the HTML code out and display as one long string.  The way around this is as follows.

     

    1.  Create a new formula field with the below as the formula:

     

    if isnull({pm_process.usr_description_html}) then {pm_process.pm_description}
    else {pm_process.usr_description_html}

     

    (where pm_process.usr_description_html is your html string field to be converted and pm_process.pm_description is non html string field)

     

    2.  Remove the existing pm_description field and replace with the formula, resize to what ever you want.

    3.  Right click on the field and select format field.

    4.  Go to the paragraph tab and in the "text interpretation" section set the value to "HTML Text".  Save changes.

     

    There are a few restrictions with this, in that it will not correctly display things like tables or images for example. A list of what HTML tags crystal will interpret can be found by pressing F1 (Help) when in Crystal reports.  Then search for the topic "Paragraph tab (various dialog boxes)".

     

    Here is a list which was correct for Crystal 10:

     

    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 attributes are:

    align
    face
    size
    color
    style
    font-family
    font-size
    font-style
    font-weight