R 使用闪亮的按钮扩展名保存pdf中的所有列
我读了很多帖子,仍然没有找到解决办法。 我的按钮扩展只下载PDF格式的一半栏,在应用程序中我看到了所有栏。我怎样才能改变它 我的应用程序就是这样的: 以下是它在pdf中的打印方式: 服务器.R中负责创建数据表的我的代码:R 使用闪亮的按钮扩展名保存pdf中的所有列,r,button,shiny,R,Button,Shiny,我读了很多帖子,仍然没有找到解决办法。 我的按钮扩展只下载PDF格式的一半栏,在应用程序中我看到了所有栏。我怎样才能改变它 我的应用程序就是这样的: 以下是它在pdf中的打印方式: 服务器.R中负责创建数据表的我的代码: output$results <- DT::renderDataTable({ DT::datatable(final, extensions =c ('ColReorder', 'Buttons', 'FixedHeader'),class = 'ce
output$results <- DT::renderDataTable({
DT::datatable(final, extensions =c ('ColReorder', 'Buttons', 'FixedHeader'),class = 'cell-border stripe', rownames = T,
caption = ' ',
colnames = c('Usługi fryzjerskie' = 5, 'Usługi kosmetyczne' = 6,'Usługi manicure' = 7,'Usługi depilacja' = 8,
'Kolor' = 9,'Sprzedaż fryzjerska' = 10,'Sprzedaż kosmetyków' = 11,'Kuracje damskie' = 12,'Kuracje meskie' = 13,
'Liczba klientów' = 14,'Liczba kobiet' = 15,'Liczba mężczyzn' = 16,'Średni paragon kliencki' = 17,
'Paragon męski' = 18,'Paragon damski' = 19) ,
options = list(
fixedHeader = TRUE,
columnDefs = list(list(className = 'dt-right', targets = "_all")),
dom = 'Blfrtip',
buttons =
list( 'copy', 'print', list(
extend = 'collection',
buttons = c('csv', 'excel','pdf'),
text = 'Download'
)),
orderClasses = TRUE,
scrollX = TRUE,
pageLength = 20,
colReorder = TRUE,
initComplete = JS(
"function(settings, json) {",
"$(this.api().table().header()).css({'background-color': '#20B2AA', 'color': '#fff'});",
"}")
))
}) #output
output$results请显示您的数据和示例代码。谢谢,我已经更新了我的posts可能的副本,但不完全是这个,我认为问题在于下载按钮给出了三个列表:excell、csv和pdf,我必须使用extend='collection'而不是extend='pdf',但是当使用extend='pdf'按钮时,“excel”和“csv”不起作用。
library(shiny)
shinyUI(fluidPage(
tags$head(
tags$style(HTML("
@import url('//fonts.googleapis.com/css?family=Anton');
h2 {
font-family: 'Anton';
font-weight: 600;
line-height: 1.3;
color: #483D8B;
}
"))
),
titlePanel("ZAMOWIENIE 1 v 2"),
sidebarLayout(
sidebarPanel( tags$head(
tags$style(type="text/css", ".well { max-width: 180px; }"),
tags$style(type="text/css", ".col-sm-4 { width: 10%;}"),
tags$style(type="text/css", "#last_month { background-color: #DCDCDC; }") ,
tags$style(type="text/css", ".control-label { line-height: 2 }")
),
actionButton("get_data", "Run report"),
actionButton("last_month", "Last month"),
dateInput('start_date', "Start date", format(Sys.Date()-1, "%Y-%m-01")),
dateInput('end_date', "End date", format(Sys.Date()-1, "%Y-%m-%d"))
),
mainPanel(tags$head(
tags$style(type="text/css", ".col-sm-8 { width: 89%; }")
),
fluidRow(
column( div(DT::dataTableOutput("results"), style = "font-size:80%"), width = 12)
),
tabsetPanel(
tabPanel(
HTML('<footer>
<h6> kontakt: Krzysztof Fronczak k.fronczak@partner.samsung.com </h6>
</footer>')
))
)
)
))