I was getting the html data from database. Below is the example :
<ul>
<li> <strong>Iam Bold </strong> <u><span style="color:Red">Iam Red Colored and Underlined</span> </u> </li>
<li> Just a Normal Text </li>
<li> Iam <b> Bold </b> <i><span style="color:Green"> and italic with colored </span></i> <u> and underlined </u> </li>
</ul>
Now the same formatting is to be there in my excel output. Please see the below image for excel output.
I know that by using Jsoup , you can parse the above html and by using XSSFRichTextString , you can show the richtext in xssfcell. Also by using bullet character i can get the bullet icon.
But i need the complete text as it was in the output. But Iam not getting any idea on how exactly to do that to get the exact output.
How to do that by using XSSFRichTextString? Please help me on this
As I said in my comment this would be tricky implmentation. You need to create a parser to intrepret the html markup and apply those as fonts. The below program can be used as a starter for the parser. It uses jericho parser for parsing html and has limited font support. However It handles the html you have given (it might be able to implmented this in a lot better way). Also you can extend this for additional font support like strike through, font size etc. You can google for various font implmentations. Hope this helps.