Free Support Forum - aspose.com

Create a href link in an excel template using smartmarker

Hi,

We want to create links to hrefs in an excel template.
We didn’t find any information regarding this so we tried:

  1. Passing a url without escaping in the xml as a value -> this failed miserably.
  2. Using things linke:
    =HYPERLINK("&=defect.defectNumberHREF", “&=defect.defectName”)
    &=HYPERLINK(defect.defectNumberHREF, defect.defectName)

Nothing worked.
How should we define the merge-field so it will show a clickable link in an excel?

Many thanks,
Yishay

@yishayh,

Thanks for providing us some details.

Please create a simple console application/code (runnable) and provide us here to show the issue (please create dynamic dataset/datatable, etc. in your code to remove any interdependence with external data source). Also provide your template file (input file containing smart markers) and output file by Aspose.Cells APIs. Moreover, an expected file with your desired hyperlinks in tact. We will check it soon.

PS. Please try our latest version/fix: Aspose.Cells v18.9.x

Hi Amjad,

that’s actaully a lot to ask.
I just want to know how we are suppose to add url links in an excel file using the cloud api.
Attached is our template file, we want to see the link in &=defect.defectNumberHREF column (somthing like https://www.google.com for example.
Defect List template Test.zip (8.5 KB)

Thanks,

Yishay

@yishayh,

Thanks for the template file.

Well, you cannot directly embed Smart Markers when writing MS Excel formulas with “=” sign in the cells. In Smart Markers we have repeat dynamic formulas where you may use MS Excel formulas/functions using Smart Markers grammar. I have updated your template file (attached) for your reference. I first embed a blank column “B” for the repeat dynamic formula, i.e., “&=&=HYPERLINK(A{r},B{r})” (inserted into C11 cell) which may work fine and dynamically. You can hide the B column later on (after processing the markers if you do not like to have “&=defect.defectName” processed in the B column.

Hope, this helps a bit.
files1.zip (8.1 KB)

Hi Amjad,

This worked just fine.

Many thanks!
Yishay

@yishayh,

Good to know that your issue is sorted out by the suggested approach in the updated file. 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.