Foxtable(狐表)用户栏目专家坐堂 → 专业报表纸张设置与打印不一致的报告。


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

主题:专业报表纸张设置与打印不一致的报告。

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


加好友 发短信
等级:五尾狐 帖子:1038 积分:12915 威望:0 精华:0 注册:2011/5/29 15:19:00
专业报表纸张设置与打印不一致的报告。  发帖心情 Post By:2013/9/24 9:00:00 [显示全部帖子]

专业报表代码如下:
(使用 Doc.Preview() 预览后,再打印,是和设置的纸张是一致的)
(使用 Doc.Print() 直接打印,是和设置的纸张是不一致的,如果放A5纸会显示不全,A4纸才能打印完全,不过会打印在左上角)

Dim Doc As New PrintDoc
Doc.PageSetting.PaperKind = 11 '设定为A5纸
Doc.PageSetting.LeftMargin = 5 '设置左边距
Doc.PageSetting.RightMargin = 5 '设置右边距
Doc.PageSetting.BottomMargin = 5 '设置上边距
Doc.PageSetting.BottomMargin = 5 '设置下边距
Doc.AutoRotate = False '禁止自动旋转打印内容
Doc.Style.F
Doc.Style.FontSize = 11
Doc.Style.FontBold = True
Dim rt As prt.RenderText
Dim x As Integer = 0 '定义水平偏移参数
Dim y As Integer = 0 '定义垂直偏移参数

Dim i,j As Integer
i = 30
j = 7
rt = new prt.RenderText
rt.Text = "中华人民共和国传染病报告卡"
rt.y = 15 + y
rt.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
rt.Style.FontSize = 14
doc.body.Children.Add(rt)

rt = new prt.RenderText
rt.Text = "卡片编号: "
rt.x = 20 + x
rt.y = i + j*0 + y
doc.body.Children.Add(rt)

rt = new prt.RenderText
rt.Text = "报卡类别: "
rt.x = 90 + x
rt.y = i + j*0 + y
doc.body.Children.Add(rt)

rt = new prt.RenderText
rt.Text = "患者姓名: "
rt.x = 20 + x
rt.y = i + j*1 + y
doc.body.Children.Add(rt)

rt = new prt.RenderText
rt.Text = "身份证号码: "
rt.x = 20 + x
rt.y = i + j*2 + y
doc.body.Children.Add(rt)

rt = new prt.RenderText
rt.Text = "性别: "
rt.x = 20 + x
rt.y = i + j*3 + y
doc.body.Children.Add(rt)

rt = new prt.RenderText
rt.Text = "出生日期: "
rt.x = 45 + x
rt.y = i + j*3 + y
doc.body.Children.Add(rt)

rt = new prt.RenderText
rt.Text = "实足年龄: "
rt.x = 100 + x
rt.y = i + j*3 + y
doc.body.Children.Add(rt)

rt = new prt.RenderText
rt.Text = "工作单位: "
rt.x = 20 + x
rt.y = i + j*4 + y
doc.body.Children.Add(rt)

rt = new prt.RenderText
rt.Text = "联系电话: "
rt.x = 20 + x
rt.y = i + j*5 + y
doc.body.Children.Add(rt)

rt = new prt.RenderText
rt.Text = "病人属于: "
rt.x = 20 + x
rt.y = i + j*6 + y
doc.body.Children.Add(rt)

rt = new prt.RenderText
rt.Text = "现住址: "
rt.x = 20 + x
rt.y = i + j*7 + y
doc.body.Children.Add(rt)

rt = new prt.RenderText
rt.Text = "户籍地址: "
rt.x = 20 + x
rt.y = i + j*8 + y
doc.body.Children.Add(rt)

rt = new prt.RenderText
rt.Text = "患者职业: "
rt.x = 20 + x
rt.y = i + j*9 + y
doc.body.Children.Add(rt)

rt = new prt.RenderText
rt.Text = "病例分类: "
rt.x = 20 + x
rt.y = i + j*10 + y
doc.body.Children.Add(rt)

rt = new prt.RenderText
rt.Text = "发病日期: "
rt.x = 20 + x
rt.y = i + j*11 + y
doc.body.Children.Add(rt)

rt = new prt.RenderText
rt.Text = "诊断日期: "
rt.x = 20 + x
rt.y = i + j*12 + y
doc.body.Children.Add(rt)

rt = new prt.RenderText
rt.Text = "死亡日期: "
rt.x = 20 + x
rt.y = i + j*13 + y
doc.body.Children.Add(rt)

rt = new prt.RenderText
rt.Text = "乙类传染病: "
rt.x = 20 + x
rt.y = i + j*14 + y
doc.body.Children.Add(rt)

rt = new prt.RenderText
rt.Text = "订正病名: "
rt.x = 20 + x
rt.y = i + j*15 + y
doc.body.Children.Add(rt)

rt = new prt.RenderText
rt.Text = "报告医生: "
rt.x = 20 + x
rt.y = i + j*16 + y
doc.body.Children.Add(rt)

rt = new prt.RenderText
rt.Text = "填卡日期: "
rt.x = 20 + x
rt.y = i + j*17 + y
doc.body.Children.Add(rt)

rt = new prt.RenderText
rt.Text = "备注: "
rt.x = 20 + x
rt.y = i + j*18 + y
doc.body.Children.Add(rt)

Doc.Preview()
'    Doc.print()

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


加好友 发短信
等级:五尾狐 帖子:1038 积分:12915 威望:0 精华:0 注册:2011/5/29 15:19:00
如果打印机这样设置,就没问题。  发帖心情 Post By:2013/9/24 9:35:00 [显示全部帖子]

会不会是没有调用到,报表的纸张设置?

打印机设置---首选项---纸张设置为A5
[此贴子已经被作者于2013-9-24 9:37:10编辑过]

 回到顶部