We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Multiple Hyperlinks in single cell of excel sheet

Hi,


We are using Aspose cell for JDK1.4 in our application. Aspose.Cells.jar version is quite older. I am not sure about it’s version, but in copyright message, it is showing (Copyright 2003 - 2010 Aspose Pty Ltd.).

We have a requirement to put multiple hyperlinks in one cell in excel sheet.

I used the following code to do that, but generated excel file shows first hyperlink only. Rest of the hyperlinks are ignored. I have attached generated excel file for reference.

Is there a way to achieve required functionality without using latest version of Aspose.Cells.jar because we want jars that can be used with JDK 1.4.

Code:

============================================================================
public static void main(String[] args) throws Exception
{
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.getWorksheets().getSheet(0);

int pictureIndex = worksheet.getPictures().add(2, 1, “D:\sweasy.jpg”, 40, 40);

Picture picture = worksheet.getPictures().get(pictureIndex);

picture.setLeft(10);

picture.addHyperlink(“http://www.google.com/”);

pictureIndex = worksheet.getPictures().add(2, 1, “D:\sweasy1.jpg”, 40, 40);

Picture picture1 = worksheet.getPictures().get(pictureIndex);
picture1.setLeft(40);
picture1.addHyperlink(“http://www.yahoo.com/”);
pictureIndex = worksheet.getPictures().add(2, 1, “D:\sweasy2.jpg”, 40, 40);

Picture picture2 = worksheet.getPictures().get(pictureIndex);
picture2.setLeft(70);

picture2.addHyperlink(“http://www.yahoo.com/”);

worksheet.getCells().setColumnWidth(1,14);
workbook.save(“D:\out1.xlsx”);
}
===========================================================================

Regards,
Ram Ochani.

Hi,


Thanks for the sample code and details.

As you are using quite an older version of the product, so, I am afraid, we cannot evaluate your issue using older APIs set. It looks to me a bug or limitation in the older APIs. But, we neither can evaluate or fix any issue in older versions, the fixes are only based on latest APIs set. We can only recommend you to upgrade to and use newer version(s). I think in newer versions (e.g Aspose.Cells for Java v17.2.0), it should work fine to include multiple hyperlinks (using shapes) in a single cell. In case, you find the issue in latest version, let us know with sample code, template file and details, we will check it and fix it soon. Moreover, if you want we can provide you JDK1.5 version of the latest version/fix.

Thank you.

Hi Amjad,


Thanks for the prompt reply. Yes, please provide me the latest version of Aspose.Cells.jar compatible with JDK 1.5 if above requirement of adding multiple hyperlinks in single cell can be achieved with latest version compatible with JDK 1.5.

Regards,
Ram Ochani.

Hi Ram Ochani,


Please find attached the JDK1.5 version of the latest version of Aspose.Cells for Java for your needs. It should work fine to add multiple hyperlinks (using shapes) in a single cell. In case, you find any issue in the latest version, let us know with sample code (runnable), template file and details, we will check it soon.

Thank you.