Foxtable(狐表)用户栏目专家坐堂 → 如何实现带字贴格式(如米字格)的生字套打


  共有2813人关注过本帖树形打印复制链接

主题:如何实现带字贴格式(如米字格)的生字套打

帅哥,在线噢!
有点蓝
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106112 积分:539671 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/12/28 10:53:00 [显示全部帖子]

模板发上来测试一下

 回到顶部
帅哥,在线噢!
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106112 积分:539671 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/12/28 16:08:00 [显示全部帖子]

execl模板不支持特殊的对象格式,建议使用专业报表,比如:

Dim doc As New PrintDoc '定义一个报表
Dim rt As New prt.RenderTable() '定义一个表格对象
doc.Body.Children.Add(rt) '将表格对象加入到报表中

rt.Style.GridLines.All = New prt.LineDef '将网格线类型设为默认类型
rt.Width = 180 '表宽为90毫米
rt.Height = 180 '表高为90毫米
rt.Rows.Count = 10 '设置行数
rt.Cols.Count = 10 '设置列数

Dim Line As New prt.LineDef(0.1, Color.Blue, DashStyle.Dash)
Dim ra As prt.RenderArea
Dim rx As prt.RenderText

For i As Integer = 0 To 9
    For j As Integer = 0 To 9
        ra = rt.Cells(i,j).Area
       Dim ln As New prt.RenderLine(0,0,1,1,Line)
        ln.Width = "Parent.Width"
        ln.Height = "Parent.Width"
        ra.Children.Add(ln)
        
       ln = New prt.RenderLine(1,0,0,1,Line)
        ln.Width = "Parent.Width"
        ln.Height = "Parent.Width"
        ra.Children.Add(ln)
        
       ln = New prt.RenderLine(1,0,1,1,Line)
        ln.Width = "Parent.Width"
        ln.Height = "Parent.Width"
        ra.Children.Add(ln)
        
       ln = New prt.RenderLine(0,1,1,1,Line)
        ln.Width = "Parent.Width"
        ln.Height = "Parent.Width"
        ra.Children.Add(ln)

        rx = New prt.RenderText
        rx.Text = "狐"
        rx.Style.FontSize = 45
        rx.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
        rx.Style.TextAlignVert = prt.AlignVertEnum.Center  '垂直居中
        ra.Children.Add(rx)
    Next
Next
Doc.Preview() '预览报表

 回到顶部
帅哥,在线噢!
有点蓝
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106112 积分:539671 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/12/28 19:46:00 [显示全部帖子]

肯定可以的,专业报表的帮助都全部过一遍先
[此贴子已经被作者于2020/12/28 19:45:48编辑过]

 回到顶部