qrilka/xlsx

Hyperlink Support

Microtribute opened this issue · 7 comments

Is it possible to make a cell a hyperlink either to an external link or to a worksheet in the same document?

Hi @Microtribute
Sorry for a late reply - was away on my vacation.
Could you show me an example workbook so I could check out the details?

@Microtribute
try workaround via formula. Something like:

let
  full_url = ...
  full_formula = Xlsx.NormalFormula . Xlsx.Formula
    $ "HYPERLINK(\"" <> full_url <> "\", \"" <> cell_text <> "\")"
in Xlsx.def { Xlsx._cellFormula = Just $ Xlsx.CellFormula full_formula False False }

It was adapted from here.

If this workaround works then what would you imagine as "proper" relplacement as a part of the library API?

Probably something like in Python

Python is a bit different from Haskell but I'm OK with adding some helper if you will create a PR.
And yet I don't understand if you want something different to the workaround above.

As for now the workaround via formula was more than enough for me. I've added it here just for somebody who will come to here via google search + github search.

PR with this as a helper is welcome