以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 如何设置单元格样式,使某列较长内容自动缩小以适应单元格宽度? (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=186593) |
-- 作者:foxtablefanse -- 发布时间:2023/5/14 14:42:00 -- 如何设置单元格样式,使某列较长内容自动缩小以适应单元格宽度? Dim doc As New PrintDoc \'定义一个报表 Dim rt As New prt.RenderTable() \'定义一个表格对象 doc.Body.Children.Add(rt) \'将表格对象加入到报表中 rt.Style.GridLines.All = New prt.Linedef \'设置网格线 \'下面的代码向表格中填入值 For r As Integer = 0 to 5 For c As integer = 0 to 5 rt.Cells(r, c).Text = r & "," & c \' Next Next rt.Style.TextAlignHorz = prt.AlignHorzEnum.Right \'所有文本内容靠右对齐 rt.Cols(0).Style.TextAlignHorz = prt.AlignHorzEnum.Center \'唯独第一列内容居中 doc.Preview() \'预览报表 |
-- 作者:有点蓝 -- 发布时间:2023/5/14 20:27:00 -- http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=64395&skin=0 |