diff --git a/NEWS.md b/NEWS.md index 49f04a8..c8a2537 100644 --- a/NEWS.md +++ b/NEWS.md @@ -5,6 +5,7 @@ * Fixed bug on continuous table outside borders. * Fixed bug with early page break when appending content dynamically. * Fixed bug on page numbers in title for RTF. +* Fixed bug where show_cols was overriding `define()` visible = FALSE. # reporter 1.4.3 diff --git a/R/sizing_functions.R b/R/sizing_functions.R index 6678ea1..01d5c8b 100644 --- a/R/sizing_functions.R +++ b/R/sizing_functions.R @@ -993,8 +993,12 @@ get_table_cols <- function(x, control_cols) { if (show_all == FALSE & def$visible) ret[length(ret) + 1] <- def$var_c - else if (show_all == TRUE & def$visible == FALSE) - ret <- ret[!ret %in% def$var_c] + #else if (show_all == TRUE & def$visible == FALSE) + else if (def$visible == FALSE) { + if (def$var_c %in% ret) { + ret <- ret[!ret %in% def$var_c] + } + } } ret <- unique(ret) diff --git a/docs/articles/reporter-wrap.html b/docs/articles/reporter-wrap.html index 1baf8e9..5fac825 100644 --- a/docs/articles/reporter-wrap.html +++ b/docs/articles/reporter-wrap.html @@ -170,7 +170,7 @@

Handle Wide Tables with Page Wrap define(cyl, label = "Cylinders", format = "%.1f") %>% define(disp, label = "Displacement") %>% define(hp, label = "Horsepower", page_wrap = TRUE) %>% - define(drat) %>% + define(drat, visible = FALSE) %>% define(wt, label = "Weight") %>% define(qsec, label = "Quarter Mile Time", width = 1.5) diff --git a/docs/man/images/e6a.png b/docs/man/images/e6a.png index 25a1451..beea061 100644 Binary files a/docs/man/images/e6a.png and b/docs/man/images/e6a.png differ diff --git a/docs/man/images/e6b.png b/docs/man/images/e6b.png index 330730d..53eb0d4 100644 Binary files a/docs/man/images/e6b.png and b/docs/man/images/e6b.png differ diff --git a/docs/news/index.html b/docs/news/index.html index 6b8e700..92e8eeb 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -115,6 +115,7 @@