xslftable的大小以查看插入后是否适合滑动
我正在插入n行数的幻灯片节目。有两个问题...
我不知道行的数量,最多有50个,我们允许的,但即使有50个也会脱离幻灯片。
我将添加到每一列的文本也可能很长。
目前,我当前的方法是允许15行,创建一个新的幻灯片来添加下一个15行,依此类推,直到我达到50
。想检查一下它是否从幻灯片中溢出,如果是,我将删除它,制作新的幻灯片,然后将其添加到新表中。
如果可能的话,请保持行高锁定,并允许隐藏任何额外的文本,直到选择单元格(类似于Excel电子表格)。
I am working on a slide show where I insert N number of rows. There are two issues...
I don't know the number of rows, there is a max of 50 we will allow but even 50 will go out of the slide.
The text I will add to each column can also be somewhat long.
Right now, my current approach is allowing 15 rows, creating a new slide to add the next 15, and so on until I hit 50.
What I would prefer to do is get the size of the table and after I finish one row, I would like to check if it is overflowing out of the slide, and if it is, I'll remove it, make a new slide, and add it to the new table.
An alternative approach if possible, is keep the row height locked, and allow any extra text to kinda be hidden until the cell is selected (similar to an excel spreadsheet).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在此处使用类似的方法
apache poi fet font font font量指标
解决方案:
stringlist均可为每行重新播放StringList
coverttoemu
只是一个数字...bands.gets.getwidth()
在72 dpi和table.gettblgrid().getGridCollist()中。 getw()
(宽度)在EMU中。 72 dpi只是以英寸为单位的像素...每英寸72像素。每英寸的emu是914400。因此,转换为914400 /72 = 12700。
最大值是“行”的数量,它需要...其余的是硬编码,但是我将我拥有的数据列表分为sublists,然后添加并添加它到每个幻灯片。我知道20行是一个不错的选择,因此,如果它比我创建一个新列表的高度要高,以添加到新的幻灯片中。
还值得注意的是,我正在使用cttable,您可以从xslftable中的方法中获得。
Using a similar approach here
Apache POI get Font Metrics
Solution:
stringList is repopulated for each row
covertToEmu
is just a number...bounds.getWidth()
is in 72 dpi andtable.getTblGrid().getGridColList().get(j).getW()
(the width) is in EMU. 72 dpi is just the pixels in inches...which is 72 pixels per inch. An EMU per inch is 914400.So convertToEmu is 914400 / 72 = 12700.
The max is the number of "rows" it takes...the rest is kinda hard coded, but I split the list of data I have into sublists and add it to each slide. I know 20 rows is a good fit so if it gets higher than that I create a new list, to add to a new slide.
Also worth noting I am using CTTable, which you can get from a method in XSLFTable.