Skip to content

Ability to change cell formats inside an existing googlesheet #179

@sanjmeh

Description

@sanjmeh

Now that googlesheets4 has achieved stability, we can shift some really serious excel (writing) work from openxlsx to googlesheets4. The only reason I still use openxlsx, even for working within goooglesheets, is that it allows creation of styles (openxlsx::createStyle) and conditional formatting (openxlsx::conditionalFormatting). The openxlsx workbook formats interwork almost fine while editing as a google sheet once uploaded, although not perfect. A lot of improvement can be brought in and a direct update of gs formats (using googlesheets4 APIs) will be much better than making changes in an offline workbook and uploading it every time.

My order of preference within createStyle function would be (in case the feature needs to be broken up):

  1. fontSize
  2. wrapText
  3. numFmt
  4. locked
  5. valign
  6. halign
  7. textdecoration (bold, itallic)
  8. bgFill (Background Fill)

Note, I have used openxlsx::createStyle() function arguments as a vocabulary only, although we could improve on their structure a bit. Also there are confusing & quirky parameters in openxlsx e.g. fgFill fills up colour in a cell rather than bgFill and gridExpand =TRUE is needed almost always while the default is FALSE.

In addition a setcolwidth functionality (as in openxlsx) is essential, as the existing range_autofit does not serve the purpose when a column has lot of text and it needs to be in wraptext mode.

Apologies if I used too many openxlsx terms but that's the only reference available to move from an excel world to the googlesheets world in R.

Thanks

Sanjay

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions