Closed shashi108 closed 7 years ago
Yours questions are too broad. Please, provide a reproducible example and your sessionInfo() result.
I got the output but i want in other way in picture 2:-
`doc <- docx(template="C:/Users/Shashi/Desktop/R-RHI-ISDN/Program/Template_table2.docx") options( "ReporteRs-fontsize" = 9, "ReporteRs-default-font" = "Courier")
par_fun<-function(x,y,z){ MyFTable <-vanilla.table( data = z ) MyFTable<-setFlexTableWidths(MyFTable,widths = c(rep(1,length(colnames(z))))) MyFTable[ to = "header" ] = textBold() MyFTable[ to = "header" ] = parCenter() MyFTable[ , 1:2 ] = parProperties( text.align = "left" ) MyFTable[ , 3:length(colnames(z))] = parProperties( text.align = "center" )
doc <- addFlexTable( doc, MyFTable,par.properties = parProperties(text.align = "center"))
writeDoc(doc, file = "EMSI_t3.1.docx") } par_fun("2.1","0-3",Table3.1) ` I want output like this:-
It is not reproducible 👎 object Table3.1
is not provided and you didn't provide your sessionInfo neither.
However, the solution to your problem is there:
http://davidgohel.github.io/ReporteRs/articles/word.html#section
sessionInfo() R version 3.3.3 (2017-03-06) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 7 x64 (build 7601) Service Pack 1
locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252 [4] LC_NUMERIC=C LC_TIME=English_United States.1252
attached base packages: [1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] rtf_0.4-11 reshape_0.8.6 lazyeval_0.2.0 Publish_1.2.3 devtools_1.12.0 prodlim_1.5.9
[7] ReporteRs_0.8.8 ReporteRsjars_0.0.2 pander_0.6.0 stargazer_5.2 formattable_0.2.0.1 magrittr_1.5
[13] tidyr_0.6.1 psych_1.6.12 Hmisc_4.0-2 ggplot2_2.2.1 Formula_1.2-1 survival_2.40-1
[19] lattice_0.20-34 dplyr_0.5.0 rJava_0.9-8
Thanks for your suggestion
How to add large width table in ReportRs package. example:- In my table have 13 columns,every columns width=1.25 so i want to first column is common in every page and every page have about 7 column.