-
-
Notifications
You must be signed in to change notification settings - Fork 638
Excel export: added a special case to add HYPERLINK Formula when text… #352
Conversation
… in the cell matches =HYPERLINK("link","name")
Hi @mdsimpson, thanks for the pull request. Before we can merge it, we need you to sign our Contributor License Agreement. You can do so electronically here: http://opensource.box.com/cla Once you have signed, just add a comment to this pull request saying, "CLA signed". Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the pull request @mdsimpson !
I'm not a big fan of one-off changes like this one. It's definitely interesting to add formulas support to Spout but it needs to be thought as a whole, not just in the scope of hyperlinks.
if ($this->shouldUseInlineStrings) { | ||
$cellXML .= ' t="inlineStr"><is><t>' . $this->stringsEscaper->escape($cellValue) . '</t></is></c>'; | ||
$matches = array(); | ||
if (preg_match('/=HYPERLINK\("(.*)","(.*)"\)/', $cellValue, $matches)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This regex should be changed to support other ways of writing the formula: /=HYPERLINK\([\'"](.*)[\'"],\s*[\'"](.*)[\'"]\)/
. This support single and double quotes as well as any number of spaces after the comma (it may also need the same \s
before the comma)
… in the cell matches =HYPERLINK("link","name")
@mdsimpson,
The entire row is colored except the hyperlink column. |
My pull request here: Appears to achieve this. |
Adaptation of a previous version PR box#352
Outdated PR |
… in the cell matches =HYPERLINK("link","name")
A very basic start at adding support for Excel function.