Foxtable(狐表)用户栏目专家坐堂 → [求助]专业报表中几个字段请教


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

主题:[求助]专业报表中几个字段请教

帅哥哟,离线,有人找我吗?
lhfu
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:196 积分:2162 威望:0 精华:0 注册:2013/5/10 15:59:00
[求助]专业报表中几个字段请教  发帖心情 Post By:2019/7/27 15:00:00 [显示全部帖子]

各位老师,我转用专用报表来套打piao据中,需要对字体放大、行距、旋转地方代码看不懂,想请教一下的

图片点击可在新窗口打开查看此主题相关图片如下:截屏图片001.jpg
图片点击可在新窗口打开查看

我是根据帮助文件,这么引用的
Dim doc As New PrintDoc 
Dim rx As prt.RenderText
Dim rm As prt.RenderImage 
doc.PageSetting.Width = 85 '纸张宽度为85毫米
doc.PageSetting.Height = 58 '纸张高度为58毫米
Doc.PageSetting.LeftMargin = 30 '设置左边距
Doc.PageSetting.RightMargin = 10 '设置右边距
Doc.PageSetting.TopMargin = 10 '设置上边距
Doc.PageSetting.BottomMargin = 10 '设置下边距

rt.Style.TextAngle = 90 '顺时钟旋转90度

rt.Style.LineSpacing = 200 '设置双倍行距

rt.Style.Font = New Font("宋体", 16, FontStyle.Bold)


Dim Currow As Row
Dim tbl As Table = Tables("合格证")
For i As Integer = tbl.TopRow To tbl.BottomRow
    CurRow = tbl.rows(i)

Dim rep As New prt.RenderEmpty '定义一个新的空对象
    rep.BreakBefore = prt.BreakEnum.Page '打印前换页
doc.Body.Children.Add(rep ) '加入到报表中

    
    rx = new prt.RenderText
    rx.Text = CurRow("型号")
    
    doc.body.Children.Add(rx)

    rx = new prt.RenderText
    rx.Text = CurRow("钢号")
    
    doc.body.Children.Add(rx)

    rx = new prt.RenderText
    rx.Text = CurRow("检验")
    doc.body.Children.Add(rx)

    rx = new prt.RenderText
    rx.Text = CurRow("日期")
    doc.body.Children.Add(rx)

   Next
Doc.PrinterName = "Canon G1010 series" '指定的打印机上打印
Doc.Preview() '预览报表
其中三行,是对字体放大、旋转和调整行行距

图片点击可在新窗口打开查看此主题相关图片如下:截屏图片002.jpg
图片点击可在新窗口打开查看

图片点击可在新窗口打开查看此主题相关图片如下:截屏图片003.jpg
图片点击可在新窗口打开查看

图片点击可在新窗口打开查看此主题相关图片如下:截屏图片04.jpg
图片点击可在新窗口打开查看

图片点击可在新窗口打开查看此主题相关图片如下:截屏图片05.jpg
图片点击可在新窗口打开查看

帮助文件说得比较简短,我还未领悟得透彻,所以请老师们帮忙指正一下,谢谢

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:管理项目4.foxdb


[此贴子已经被作者于2019/7/27 15:02:21编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
lhfu
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:196 积分:2162 威望:0 精华:0 注册:2013/5/10 15:59:00
  发帖心情 Post By:2019/7/27 19:04:00 [显示全部帖子]

Dim doc As New PrintDoc 
Dim rx As prt.RenderText
Dim rm As prt.RenderImage 
doc.PageSetting.Width = 85 '纸张宽度为85毫米
doc.PageSetting.Height = 58 '纸张高度为58毫米
Doc.PageSetting.LeftMargin = 30 '设置左边距
Doc.PageSetting.RightMargin = 10 '设置右边距
Doc.PageSetting.TopMargin = 10 '设置上边距
Doc.PageSetting.BottomMargin = 10 '设置下边
Dim rep As New prt.RenderEmpty '定义一个新的空对象
    rep.BreakBefore = prt.BreakEnum.Page '打印前换页
doc.Body.Children.Add(rep ) '加入到报表中
Dim Currow As Row
Dim tbl As Table = Tables("合格证")
For i As Integer = tbl.TopRow To tbl.BottomRow
    CurRow = tbl.rows(i)

rx = new prt.RenderText    
rx.Text = CurRow("型号")
rx.Style.TextAngle = 90 '顺时钟旋转90度
rx.Style.LineSpacing = 200 '设置双倍行距
rx.Style.Font = New Font("宋体", 16, FontStyle.Bold)

rx = new prt.RenderText    
rx.Text = CurRow("钢号")
rx.Style.TextAngle = 90 '顺时钟旋转90度
rx.Style.LineSpacing = 200 '设置双倍行距
rx.Style.Font = New Font("宋体", 16, FontStyle.Bold)
Next
Doc.PrinterName = "Canon G1010 series" '指定的打印机上打印
Doc.Preview() '预览报表
这个修改过后,打印预览是空白的

 回到顶部
帅哥哟,离线,有人找我吗?
lhfu
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:196 积分:2162 威望:0 精华:0 注册:2013/5/10 15:59:00
  发帖心情 Post By:2019/7/28 22:32:00 [显示全部帖子]

蓝老师,我想问一下,如果不用x、y来确认文字位置的情况下,换成居中、左边对齐、自动回车这样的语句,是否也起到一定的效果呢?

图片点击可在新窗口打开查看此主题相关图片如下:图片 (1).jpg
图片点击可在新窗口打开查看

Dim doc As New PrintDoc
Dim rx As prt.RenderText
Dim rm As prt.RenderImage
doc.PageSetting.Width = 58  '纸张宽度为85毫米
doc.PageSetting.Height = 85 '纸张高度为58毫米
Doc.PageSetting.LeftMargin = 10 '设置左边距
Doc.PageSetting.RightMargin = 10'设置右边距
Doc.PageSetting.TopMargin = 0 '设置上边距
Doc.PageSetting.BottomMargin = 0 '设置下边

Dim Currow As Row
Dim tbl As Table = Tables("合格证")
For i As Integer = tbl.TopRow To tbl.BottomRow
    CurRow = tbl.rows(i)

Dim rep As New prt.RenderEmpty '定义一个新的空对象
    rep.BreakBefore = prt.BreakEnum.Page '打印前换页
    doc.Body.Children.Add(rep ) '加入到报表中

 rx = new prt.RenderText
rx.x = 10
rx.y = 30
 rx.Text = CurRow("型号")
rx.Style.TextAngle = 90 '顺时钟旋转90度
rx.Style.LineSpacing = 10 '设置双倍行距
rx.Style.Font = New Font("宋体", 16, FontStyle.Bold)
doc.Body.Children.Add(rx) '加入到报表中

rx = new prt.RenderText
rx.x = 20
rx.y = 30
 rx.Text = CurRow("钢号")
rx.Style.TextAngle = 90 '顺时钟旋转90度
rx.Style.LineSpacing = 10 '设置双倍行距
rx.Style.Font = New Font("宋体", 16, FontStyle.Bold)
doc.Body.Children.Add(rx) '加入到报表中

rx = new prt.RenderText
rx.x = 30
rx.y = 30
 rx.Text = CurRow("检验")
rx.Style.TextAngle = 90 '顺时钟旋转90度
rx.Style.LineSpacing = 10 '设置双倍行距
rx.Style.Font = New Font("宋体", 16, FontStyle.Bold)
doc.Body.Children.Add(rx) '加入到报表中

rx = new prt.RenderText
rx.x = 40
rx.y = 30
 rx.Text = CurRow("日期")
rx.Style.TextAngle = 90 '顺时钟旋转90度
rx.Style.LineSpacing = 10 '设置双倍行距
rx.Style.Font = New Font("宋体", 16, FontStyle.Bold)
doc.Body.Children.Add(rx) '加入到报表中
Next
'Doc.PrinterName = "Canon G1010 series" '指定的打印机上打印
Doc.Preview() '预览报表



 回到顶部
帅哥哟,离线,有人找我吗?
lhfu
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:196 积分:2162 威望:0 精华:0 注册:2013/5/10 15:59:00
  发帖心情 Post By:2019/7/28 23:31:00 [显示全部帖子]

好的,谢谢

 回到顶部