I have the following:
String cadena="<ul><li>test </li><li>test 2</li></ul>"
HSSFCell cell = row.createCell((short)0);
cell.setCellValue(cadena)
I would like the cell to take the html format or in the worst case to eliminate the html
I have the following:
String cadena="<ul><li>test </li><li>test 2</li></ul>"
HSSFCell cell = row.createCell((short)0);
cell.setCellValue(cadena)
I would like the cell to take the html format or in the worst case to eliminate the html
To format the excel:
This is a question similar to yours, whose answer is to go interpreting the labels to put the format in excel adequate.
I made a very alpha demo of processing the string with regex so that it takes the labels and then depending on the ones that you read, apply the necessary style so that excel recognizes it:
To remove the HTML
Use Jsoup
public static String quitarHTML(String html) {
return Jsoup.parse(html).text();
}
If you do not want to use external libraries, you can use
To remove the tags HTML
of String
you can use the library Jsoup :
public static String htmlATexto(String html) {
return Jsoup.parse(html).text();
}
If you are programming in Android
simply use this:
android.text.Html.fromHtml(instruction).toString()