Shiny Datatable conditional formatting

117 views
Skip to first unread message

Christian Brandstätter

unread,
May 19, 2016, 2:34:52 AM5/19/16
to Shiny - Web Framework for R
Dear Group,

I am rather stuck at a problem regarding conditional formatting. I used the github-version of DT and could apply a formatstyle in the browser window.
But when using the download button (button extension) the file is saved without formatting. Would you have any suggestions?
More detailed: http://stackoverflow.com/questions/37280333/r-datatable-button-with-conditional-formatting

Best, Christian

Yihui Xie

unread,
Jul 26, 2016, 6:44:57 PM7/26/16
to Christian Brandstätter, Shiny - Web Framework for R
Unfortunately this does not seem to be possible. formatStyle() is
based on JavaScript, and the Buttons extension does not execute the
JavaScript code when you download the data to Excel or PDF. After some
brief testing, I found colors were not preserved when you simply print
the web page as PDF in Chrome, so I guess we have to resort to the
"stone-age" approach, i.e. take a screenshot of the table.

Regards,
Yihui
> --
> You received this message because you are subscribed to the Google Groups
> "Shiny - Web Framework for R" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to shiny-discus...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/shiny-discuss/3408cd87-f630-49f8-9aea-517d7ae8e9ec%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages