@urbastiba,
Aspose.Cells formula calculation engine by default cannot resolve this issue because the resultant hyperlink by HYPERLINK formula cannot be put into the hyperlink collection of the worksheet (it is MS Excel’s behavior). For your, you can put the resultant hyperlinks into sheet’s hyperlink collection by using a custom engine manually, see the sample code for your reference:
e.g
Sample code:
workbook.CalculateFormula(new CalculationOptions(){CustomEngine = new MyHyperlinkEngine()});
private class MyHyperlinkEngine : AbstractCalculationEngine
{
public override void Calculate(CalculationData data)
{
HyperlinkCollection hc = data.Worksheet.Hyperlinks;
object address = data.GetParamValue(0);
if (address != null)
{
hc.Add(data.Cell.Name, 1, 1, address.ToString());
}
}
}
After calculating formulas in this way, the generated hyperlinks are in the hyperlink collection too and so they will be printed to the PDF and you can get the expected results. However, because it modified the original workbook and make different behavior from what it should be, so you should not reuse the workbook object later on after saving operation. And, we will consider to do it automatically in upcoming fixes/versions for the users without such impact for the original workbook object when they set PdfSaveOptions.setCalculateFormula(true)
. We have already logged a ticket for it with an id “CELLSNET-46254” for the enhancements.
Once we have an update on it, we will let you know here.