Search code examples
crystal-reportscrystal-reports-2008

Set strikeout for specific value only in Crystal Report


I am sorry before if the title is not too descriptive.

My goal is to create report like this (ignore the red line): sample

In the Height (m) field, I create formula in the Formula Fields to check two values of height.

If IsNull({stored.RevisedHeight}) or {stored.RevisedHeight} = "" then
    {stored.Height} 
Else
    {stored.Height} + ChrW(13) + {stored.RevisedHeight}

I need to set strikeout style for value {stored.Height} only in the Else condition.

Thanks in advance.


Solution

  • Use

    If IsNull({stored.RevisedHeight}) or {stored.RevisedHeight} = "" then
        {stored.Height} 
    Else
        "<Strike>" + {stored.Height} + "</Strike>" + ChrW(13) + {stored.RevisedHeight}
    

    Right-click the formula object on the report canvas, Format Field... select Paragraph tab, set Text Interpretation option to 'HTML Text'.