FontUnderlineType.WORDS usage throws exception

Hi Team,

The underline type - FontUnderlineType.WORDS when applied to a cell style gives “Invalid FontUnderlineType value” exception. What is the reason behind this? How is this underline type used then?

We use Aspose.cells java 18.7 version.
Following code may help to reproduce the issue:
public static void main(String[] args) throws Exception
{
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.getWorksheets().get(0);
Cell a = worksheet.getCells().get(CellsHelper.cellIndexToName(0, 0));
a.setValue(“RPEAsposecells”);
Style style = a.getStyle();
style.getFont().setUnderline(FontUnderlineType.WORDS);
a.setStyle(style);
workbook.save(“D:\issues\ABC\work.xlsx”);
}
gives below exception:
com.aspose.cells.CellsException: Invalid FontUnderlineType value
at com.aspose.cells.zawk.x(Unknown Source)
at com.aspose.cells.zwh.a(Unknown Source)
at com.aspose.cells.zwh.i(Unknown Source)
at com.aspose.cells.zwh.a(Unknown Source)
at com.aspose.cells.zuh.a(Unknown Source)

@Akash007,

Thanks for the sample code segment and details.

After an initial test, I am able to observe the issue as you mentioned by using your sample code. I got an an exception “com.aspose.cells.CellsException: Invalid FontUnderlineType value” when using FontUnderlineType.WORDS while setting the font style. I have logged a ticket with an id “CELLSJAVA-42823” for your issue. We will look into it soon.

Once we have an update on it, we will let you know here.

@Akash007,

This is to inform you that we have fixed your issue (logged earlier as “CELLSJAVA-42823”) now. For your information, FontUnderlineType.WORDS only works for text of the shapes. We will soon provide you the fixed version after performing QA and incorporating other enhancements and fixes.

@Akash007,

Please try our latest version/fix: Aspose.Cells for Java v19.1.6:

aspose-cells-19.1.6.zip (6.4 MB)

Your issue should be fixed in it.

Let us know your feedback.

@Amjad_Sahi Thanks for the update. I tested the new jar and found it to be working :slight_smile:

@Akash007,

Good to know that your issue is sorted out by the new version/fix. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.

The issues you have found earlier (filed as CELLSJAVA-42823) have been fixed in Aspose.Cells for Java 19.2. This message was posted using BugNotificationTool from Downloads module by Amjad_Sahi