davidgohel / ReporteRs

Note that ReporteRs has been removed from CRAN the 16th of July 2018 and is not maintained anymore. please migrate to officer.
244 stars 44 forks source link

docx object could not be created using template generated with LibreOffice #211

Closed rnewbie closed 7 years ago

rnewbie commented 7 years ago
Error in .jcall(obj, "V", "setDocPropertyTitle", title) :  java.lang.NullPointerException
> version
               _                           
platform       x86_64-suse-linux-gnu       
arch           x86_64                      
os             linux-gnu                   
system         x86_64, linux-gnu           
status                                     
major          3                           
minor          3.1                         
year           2016                        
month          06                          
day            21                          
svn rev        70800                       
language       R                           
version.string R version 3.3.1 (2016-06-21)
nickname       Bug in Your Hair           
> packageVersion("ReporteRs")
[1] ‘0.8.8’
> packageVersion("rJava")
[1] ‘0.9.8’
> packageVersion("ReporteRsjars")
[1] ‘0.0.2’
jurbanhost commented 6 years ago

Error in .jcall(obj, "V", "setDocPropertyTitle", title) : java.lang.NullPointerException

version _
platform x86_64-w64-mingw32
arch x86_64
os mingw32
system x86_64, mingw32
status
major 3
minor 4.3
year 2017
month 11
day 30
svn rev 73796
language R
version.string R version 3.4.3 (2017-11-30) nickname Kite-Eating Tree

packageVersion("ReporteRs") [1] ‘0.8.8.9002’ packageVersion("rJava") [1] ‘0.9.9’ packageVersion("ReporteRsjars") [1] ‘0.0.2’

system("java -version") java version "1.8.0_151" Java(TM) SE Runtime Environment (build 1.8.0_151-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)

davidgohel commented 6 years ago

@jurbanhost This question has been tagged as invalid because there were no sessionInfo() nor reproducible example. If you want help, provide these elements.

jurbanhost commented 6 years ago

@davidgohel Thanks for answer!

sessionInfo() R version 3.4.3 (2017-11-30) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale: [1] LC_COLLATE=Russian_Russia.1251 LC_CTYPE=Russian_Russia.1251 LC_MONETARY=Russian_Russia.1251 LC_NUMERIC=C
[5] LC_TIME=Russian_Russia.1251

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] bindrcpp_0.2 readr_1.1.1 googlesheets_0.2.2 ReporteRs_0.8.8.9002 ReporteRsjars_0.0.2 openxlsx_4.0.17 DT_0.2
[8] stringr_1.2.0 dplyr_0.7.4 rJava_0.9-9

loaded via a namespace (and not attached): [1] zip_1.0.0 Rcpp_0.12.14 cellranger_1.1.0 compiler_3.4.3 bindr_0.1 R.methodsS3_1.7.1 R.utils_2.6.0 base64enc_0.1-3
[9] tools_3.4.3 digest_0.6.12 uuid_0.1-2 jsonlite_1.5 tibble_1.3.4 pkgconfig_2.0.1 png_0.1-7 rlang_0.1.4
[17] shiny_1.0.5.9000 curl_3.0 yaml_2.1.15 httr_1.3.1 officer_0.2.0 xml2_1.1.1 knitr_1.17 hms_0.4.0
[25] gdtools_0.1.6 htmlwidgets_0.9 glue_1.2.0 R6_2.2.2 rvg_0.1.7 purrr_0.2.4 magrittr_1.5 htmltools_0.3.6
[33] assertthat_0.2.0 mime_0.5 xtable_1.8-2 httpuv_1.3.5 stringi_1.1.6 R.oo_1.21.0

davidgohel commented 6 years ago

Sorry to insist :) the question has been tagged as invalid because there were no sessionInfo() nor reproducible example. If you want help, provide these TWO elements.

jurbanhost commented 6 years ago

Uh, sorry for me, example:

library(ReporteRs)

doc <- docx(title = "test", template = "c:/app/test1.docx")

test1.docx

test1.docx created from LibreOffice 5.4.3.2 and saved in Open Office XML (.docx) format

davidgohel commented 6 years ago

Thanks, I can see the issue now.

I think LO is generating an invalid document. Saving it from Word make the error disappearing. LO is always causing issues:

Will try to solve that later this month or next month.

jurbanhost commented 6 years ago

@davidgohel

Big thanks!