xlsx icon indicating copy to clipboard operation
xlsx copied to clipboard

Hyperlink Support

Open Microtribute opened this issue 3 years ago • 7 comments

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

Microtribute avatar Jul 27 '21 17:07 Microtribute

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?

qrilka avatar Aug 02 '21 19:08 qrilka

@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.

GulinSS avatar Apr 12 '24 10:04 GulinSS

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

qrilka avatar Apr 12 '24 10:04 qrilka

Probably something like in Python

GulinSS avatar Apr 12 '24 11:04 GulinSS

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.

qrilka avatar Apr 12 '24 11:04 qrilka

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.

GulinSS avatar Apr 12 '24 11:04 GulinSS

PR with this as a helper is welcome

qrilka avatar Apr 12 '24 11:04 qrilka