以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  专业报表 斑马gk888t打印的时候总是不能横打 怎么调整呢?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=174568)

--  作者:cnsjroom
--  发布时间:2022/1/21 11:08:00
--  专业报表 斑马gk888t打印的时候总是不能横打 怎么调整呢?
代码如下:
内容预览的时候是横的,纸张也是横的,打印机怎么设置都是只打印竖的  ,更改了打印机器属性也无用

Dim doc As New PrintDoc() \'定义一个报表

Doc.PageSetting.LeftMargin = 1 \'设置左边距
Doc.PageSetting.RightMargin =1 \'设置右边距
Doc.PageSetting.TopMargin = 1 \'设置上边距
Doc.PageSetting.BottomMargin = 1 \'设置下边距

Dim rt As prt.RenderText \'定义一个文本对象
Dim bg As New prt.RenderTable() \'定义一个表格对象
doc.Body.Children.Add(bg ) \'将表格对象加入到报表中
bg .Style.GridLines.All = New prt.LineDef \'将网格线类型设为默认类型
bg .Width = 88 \'表宽为150毫米
bg .Height = 58 \'表高为150毫米
bg .Rows.Count = 5 \'设置行数
bg .Cols.Count = 4 \'设置列数
bg.Cols(0).Width = 10
bg.Cols(1).Width = 30
bg.Cols(2).Width = 10
bg.Cols(3).Width = 30
bg.Style.TextAlignHorz = prt.AlignHorzEnum.Center \'水平居中
bg.Style.TextAlignVert = prt.AlignVertEnum.Center \'垂直居中
bg.Style.WordWrap = True
bg.Cells(0, 0).Text="用途"
bg.Cells(0, 1).Text="涉密计算机专用办案"
bg.Cells(0, 2).Text="密级"
bg.Cells(0, 3).Text="机密"
bg.Cells(1, 0).Text="部门"
bg.Cells(1, 1).Text="信息技术保障"
bg.Cells(1, 2).Text="房号"
bg.Cells(1, 3).Text="信息技术保障室1036"
bg.Cells(2, 0).Text="型号"
bg.Cells(2, 1).Text="联想m4700pc"
bg.Cells(2, 2).Text="IP地址"
bg.Cells(2, 3).Text="192.168.244.123"
bg.Cells(3, 0).Text="责任人"
bg.Cells(3, 1).Text="周x"
bg.Cells(3, 2).Text="编号"
bg.Cells(3, 3).Text="waxjwzd6768768"
bg.Cells(4, 0).Text="涉密专用机,严禁非法外联"
bg.Cells(4,0).SpanCols = 4 \'第5行第2个单元格向右合并3列
doc.AutoRotate = False 
doc.PageSetting.Landscape = True 

doc.PageSetting.Width = 90 \'纸张宽度为100毫米
doc.PageSetting.Height = 60 \'纸张高度为120毫米
\'Doc.PrinterName = "ZDesigner GK888t (EPL)"
\'doc.Print()
doc.Preview() \'预览

--  作者:有点蓝
--  发布时间:2022/1/21 11:15:00
--  
添加自定义纸张,并设置为默认纸张了吗?

只能直接打印,不能在预览里打印

另外去掉doc.PageSetting.Landscape = True 

--  作者:WELOVEFOX
--  发布时间:2022/1/22 9:14:00
--  
\'Doc.PrinterName = "ZDesigner GK888t (EPL)"
此句须为注释,如为真实,驱动未正确安装,USB型号,驱动正确识别型号ZDesigner GK888t,再怎么设置,打印效果99%都是错的。
可搜索本人对于帖子ZDesigner GK888t的一些常见回答。