Blog

Use HTML in Crystal Reports to format formula field

Posted by Prabhu Raja Blogs | Crystal Reports C# Aug 29, 2011
Integrate HTML tags with your Crystal Report formula fields to format your content dynamically. I gave a simple example for how to bold a selected text using <b></b> Html tag in Crystal Report.
If you want to bold, italic or under-line a text, then you can use Html support in crystal report. Also you can enjoy other features of html in crystal report  by using html tags. Here i am showing very simple example how to bold selected text in formula field using HTML. Try this one,

create a new formula -> (Enter the following text in your formula editor) ,
    
'<b>TRIPLICATE</b> - For Authorised Dealer's record. '

Here i enclosed the text with Single Quotes ( ' ' ) because i am going to print a static content in crystal Report. If you want to format a Field from DataSource (dynamic Content), You can change the Code to 

'<b>'+{ DataSourceName.DataSourceColumnFieldName }+'</b>'
 
Place your Formula Field in Crystal Report, then right click on the field and select Format Object

Untitled-7.gif

select Paragraph tab
Change Text Interpretation Combo Box Option to "HTML Text"


Run your Report,  you will get the following result

TRIPLICATE - For Authorised Dealer's record.

Thank you. if you have any Suggestions and Comments about my blog, Please let me know.
COMMENT USING
PREMIUM SPONSORS
MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.
SPONSORED BY
  • MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.