flextable

Gwt getCellForEvent flexTable

倾然丶 夕夏残阳落幕 提交于 2019-12-13 01:12:56
问题 I`m trying to add addValueChangeHandler function to a TextBox inside a flexTable. But when I add this code: int rowIndex = tableImages.getCellForEvent(event).getRowIndex(); I use this method to know the current row in case of a ClickEvent. the method is not acceptable for ValueChangeEvent, so how can I know what is the row Index for the changed cell? Thank you. 回答1: Well yes, because it needs a Cell itself, not a TextBox or event value. What you can do, is: Get the event Source via event

Is it possible to generate the RTable (FlexTable) in pdf with RMarkdown?

狂风中的少年 提交于 2019-12-12 10:10:58
问题 I am just curious that is it possible to generate the RTable (FlexTable) in pdf with RMarkdown? I can generate it in html output but it is not working for pdf output. I google this question but there is no exact answer for it. My code: ```{r, echo=FALSE, results='asis'} library(ReporteRsjars) library(ReporteRs) library(rtable) library(dplyr) vanilla.table(iris) ``` Since it can generate in word, I assume it is possible for the pdf one. I have tried cat(as.html(vanilla.table(iris))) but it is

R officer - Nest Dataframe Into Grouped List And Export Tables to Word With Group Headers

跟風遠走 提交于 2019-12-11 15:14:34
问题 I read a similar question that helped me get to the point I'm at now, but am struggling with the next step. I have a dataframe similar to below - Product = c("Apple", "Apple", "Banana", "Banana", "Banana", "Carrot", "Carrot") Category = c(1, 2, 1, 2, 3, 1, 2) Slope = c(2.988, 2.311, 2.181, 6.387, 2.615, 7.936, 3.267) df = data.frame(Product, Category, Slope) My objective is to have a Word report with a table for each product. To do this, I create a list with the data and flextables, as below

GWT - Big tables load slow on IE7/8

你离开我真会死。 提交于 2019-12-11 13:58:23
问题 I got a table which has no pagination, hence all records need to be displayed in one big flow with scrollbar. Using Flex table for the same. Firefox has no big issues in loading the page, it loads 7000 records in about 90 seconds. But IE simply hangs with 800 records! Our technical architect recommends to use celltable widget with innerhtml instead of full-fledged widgets. 回答1: GWT's Grid and FlexTable are derived from a standard HTMLTable. Basically, every time you insert a table row, IE

Format Numbers in FlexTable

偶尔善良 提交于 2019-12-11 00:01:37
问题 I am using ReporteRs to generate a flexTable using the following piece of code: library( ReporteRs ) baseCellProp <- cellProperties( padding = 2 ) baseParProp <- parProperties(text.align = "center") ft.list <- list(mua= 1, mub = 2, mug = 1e-7) ft.data <- t(data.frame(ft.list)) ft.FlexTable <- FlexTable( data = ft.data, add.rownames = TRUE, header.columns = FALSE, body.cell.props = baseCellProp, body.par.props = baseParProp) ft.FlexTable <- setFlexTableWidths(ft.FlexTable, widths =c(1,2)) ft

getCell(row,col) in GWT HTMLTable

风格不统一 提交于 2019-12-10 19:54:42
问题 There is no such method in HTMLTable: Cell c = getCell(row,col); What is the most effective way of getting a cell in an HTML/Flex Table, given the row and column? 回答1: Depends on what you want to do. If you want to read/write the content of the cell, you might want to use HTMLTable#setText(int,int) and HTMLTable#getText(int,int) , or HTMLTable#setWidget(int,int) and HTMLTable#getWidget(int,int) , if the content of the cell is a widget. There are more functions to read/write properties of the

add caption to flextable in docx

牧云@^-^@ 提交于 2019-12-10 15:37:11
问题 How could one add a caption to a flextable rendered to docx? EDIT: The aim is to produce a proper caption which can be referenced within the document to produce a list of tables and inline references. iris.t <- iris[1:5,] %>% regulartable() %>% style(pr_c = officer::fp_cell(vertical.align = "bottom", border.bottom = officer::fp_border(width = 2)), part = "header") %>% rotate(j = names(iris)[-c(1:2)], rotation = "tbrl", part = "header", align = "bottom") %>% height(height = max(dim_pretty(.,

Adding image to flextable using function

不羁的心 提交于 2019-12-08 17:31:40
I am using Officer to create a Word document, which is a large table. Into this table I want to insert some images. To do this I am using flextable. The following code inserts an image into the flextable. pupil.tbl <- tribble( ~col1, ~col2, paste("Name:", pupil$name), paste("Class:", pupil.class), "attendance_graph", "boxall_graph" ) # add attendance plot pupil.ft <- flextable(as.data.frame(pupil.tbl)) pupil.ft <- display( pupil.ft, i=2, col_key = "col1", pattern = "{{att_tbl}}", formatters = list( att_tbl ~ as_image( col1, src = "attendance.png", width = 3.3, height = 1.65) ) ) ) This works

How to knit_print flextable with loop in a rmd file

左心房为你撑大大i 提交于 2019-12-08 06:58:22
问题 I am trying to produce mutltiple tables using the flextable and kable packages. When I want to output some table iteratively, I found knit_print of flextable is not working in loop. Below is a minimal example: --- output: word_document --- ```{r} library(flextable) library(knitr) ``` ```{r} data(cars) speed<-unique(cars$speed) for (v in 1:length(speed)) { carspd<-cars[which(cars$speed==speed[v]),] tb<-regulartable(carspd) knit_print(tb) } knit_print(tb) ``` Just the last knit_print can print

Adding image to flextable using function

天大地大妈咪最大 提交于 2019-12-08 03:50:52
问题 I am using Officer to create a Word document, which is a large table. Into this table I want to insert some images. To do this I am using flextable. The following code inserts an image into the flextable. pupil.tbl <- tribble( ~col1, ~col2, paste("Name:", pupil$name), paste("Class:", pupil.class), "attendance_graph", "boxall_graph" ) # add attendance plot pupil.ft <- flextable(as.data.frame(pupil.tbl)) pupil.ft <- display( pupil.ft, i=2, col_key = "col1", pattern = "{{att_tbl}}", formatters =