Download excel file

132 views
Skip to first unread message

nadeem saif

unread,
May 5, 2016, 2:54:53 AM5/5/16
to Shiny - Web Framework for R
The following error was thrown in the browser when trying to download data in excel format : 

FileNotFoundException (Java): File 'file533b2fb98548.xlsx' could not be found - you may specify to automatically create the file if not existing.

code used for download : 

downloadExcel <- function(tabsel,dates){
  downloadHandler(filename = function() { "output.xlsx" },
                  content = function(file){
                    wb <- XLConnect::loadWorkbook(file, create = FALSE)
                    XLConnect::createSheet(wb, name = "Sheet1")
                    writeWorksheet(wb, dayProfile(tabsel, dates), sheet = "Sheet1") # writes day profile in file
                    saveWorkbook(wb)
                  })
}

Unable to figure out the issue!
Any help will be much appreciated! Thanks!

Joe Cheng

unread,
May 5, 2016, 3:42:17 PM5/5/16
to nadeem saif, Shiny - Web Framework for R
Maybe create=TRUE instead?

--
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/102a2b9d-4a46-4835-aeab-ba4a17a9fe4f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

nadeem saif

unread,
May 9, 2016, 1:30:31 AM5/9/16
to Shiny - Web Framework for R, nadeem.elec...@gmail.com
Thanks for the Response Joe! Changed create=TRUE but the error persists!

Error in .jnew("java/io/File", file) : 
  argument "file" is missing, with no default
Warning: Error in .jnew: argument "file" is missing, with no default

Joe Cheng

unread,
May 9, 2016, 6:02:07 PM5/9/16
to nadeem saif, Shiny - Web Framework for R
Strange that there's no error stack trace. Are you using the latest version of Shiny from CRAN or GitHub? If not, can you try upgrading?

nadeem saif

unread,
May 10, 2016, 12:45:32 AM5/10/16
to Shiny - Web Framework for R, nadeem.elec...@gmail.com
The shiny version I am using seems to be up to date. Used the command "packageVersion("shiny")" in RStudio - got the version as 0.13.2

nadeem saif

unread,
May 10, 2016, 7:35:14 AM5/10/16
to Shiny - Web Framework for R, nadeem.elec...@gmail.com
Hey Joe! I solved it by using write.table() instead of doing the whole load workbook, create worksheet, write worksheet and save workbook.

Thanks a ton for your help!!
Reply all
Reply to author
Forward
0 new messages