Free Support Forum - aspose.com

Issue in Smart Marker using HTML tag

Hi Team,

I have a text like below mentioned to be replaced with a smart marker.

Shared vs. ORIGINEL ATO DEO FEM ORIGINEL&PUR ANTI TRACES FRAICHEUR DOUCE 200 FDR AUTRE 1X *
Country : France 


When using the above text I should get the text as below:

Shared vs. ORIGINEL ATO DEO FEM ORIGINEL&PUR ANTI TRACES FRAICHEUR DOUCE 200 FDR AUTRE 1X *
Country : France ;

But the tags are not getting applied and the same text is coming.

May I know the reason for which this issue is coming.

Please find the attached excel to understand the issue better.

Thanks in advance!

Regards,
Sanjeev

Hi Sanjeev,

Thanks for your posting and using Aspose.Cells.

I have looked into this issue and found that the problem is occurring because of nbsp; if we remove it then it works fine.

I have tested this issue with the following sample code using the latest version: Aspose.Cells
for Java v8.5.1.2
and it generated correct expected results.

I have attached the output excel file generated by the code for your reference.

Java


Workbook workbook = new Workbook();

WorkbookDesigner designer = new WorkbookDesigner();

designer.setWorkbook(workbook);


Worksheet worksheet = workbook.getWorksheets().get(0);

worksheet.getCells().get(“A1”).putValue("&=$VariableArray(HTML)");

designer.setDataSource(“VariableArray”, new String[] { “Shared vs. ORIGINEL ATO DEO FEM ORIGINEL&PUR ANTI TRACES FRAICHEUR DOUCE 200 FDR AUTRE 1X *
Country : France :”, “Arabic”, “Hindi”, “Urdu”, “French” });

designer.process();


//set wrap text of cell A1

Cell cell = worksheet.getCells().get(“A1”);

Style style = cell.getStyle();

style.setTextWrapped(true);

cell.setStyle(style);


//Autofit column A

worksheet.autoFitColumn(0);


workbook.save(“dest.xlsx”);