Foxtable(狐表)用户栏目专家坐堂 → 图片动态打印问题,求助。


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

主题:图片动态打印问题,求助。

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2014/4/9 11:02:00 [显示全部帖子]

 测试了一下,你合并0.0单元格的时候,需要指定一下填充模式

 

'--- 定义参数
Dim mypath As String =args(0)
Dim xmBH As String = args(1)
Dim xmName As String = args(2)
Dim xmImgName As String = args(3)
Dim xmImgBh As String = args(4)
Dim ImgSj As String = args(5)
Dim ImgSh As String = args(6)
Dim ImgShrq As String = args(7)
Dim Cpsm As String = args(8)
'---开始制表
Dim Doc As new PrintDoc
Doc.PageSetting.TopMargin = 10
Doc.PageSetting.BottomMargin = 10
Doc.PageSetting.LeftMargin = 10
Doc.PageSetting.RightMargin = 10
Doc.PageSetting.Landscape = True
'---定义图纸
Dim img As new prt.RenderImage
img.Image = Getimage(mypath)
'---绘制表格
Dim rt As new prt.RenderTable
rt.Rows.Count = 10
rt.Cols.Count  = 3
rt.Height = 10 * 20
rt.Width = "Parent.width"
rt.Cols(0).Width = 80%
rt.Cols(1).Width = 7%
rt.Cols(2).Width = 13%
rt.Style.GridLines.all = new prt.LineDef
rt.Style.TextAlignHorz=prt.AlignHorzEnum.Center
rt.Style.TextAlignVert = prt.AlignVertEnum.Center
rt.Style.Font = new font("微软雅黑",11)
rt.Cells(0,0).SpanRows = 10
rt.Cells(0,0).VertSplitBehavior = prt.CellSplitBehaviorEnum.cut
rt.Cells(0,1).SpanCols = 2
rt.Cells(0,0).RenderObject = img
'-- 表格赋值
Dim imglogo As new prt.RenderImage
imglogo.Image = Getimage("Armoita.jpg")
imglogo.Style.Padding.Left = 10
rt.Rows(0).Height = 30
rt.Cells(0,1).RenderObject = imglogo
For n As Integer = 1 To 4
    rt.Rows(n).Height = 11
    rt.Rows(n).Style.TextAlignHorz = prt.AlignHorzEnum.Left
Next
For n As Integer = 5 To 8
    rt.Rows(n).Height = 9
Next
rt.Cells(1,1).SpanCols = 2
rt.Cells(1,1).text = "  项目编号:" & xmBh
rt.Cells(2,1).SpanCols = 2
rt.Cells(2,1).text = "  项目名称:" & xmName
rt.Cells(3,1).SpanCols = 2
rt.Cells(3,1).text = "  图纸名称:" & xmImgName.Replace(chr(10),"")
rt.Cells(4,1).SpanCols = 2
rt.Cells(4,1).text = "  图纸编号:" & xmImgBh
rt.Cells(5,1).text = "设计"
rt.Cells(5,2).text = ImgSj
rt.Cells(6,1).text = "审核"
rt.Cells(6,2).text = ImgSh
rt.Cells(7,1).text = "日期"
rt.Cells(7,2).text = ImgShrq
rt.Cells(8,1).text = "图号"
rt.Cells(8,2).text = xmImgBh
rt.Cells(9,1).SpanCols = 2
rt.Cells(9,1).text = " 产品说明:" & chr(10) & " " & Cpsm
rt.Cells(9,1).Style.TextAlignHorz = prt.AlignHorzEnum.Left
rt.Cells(9,1).Style.TextAlignVert=prt.AlignVertEnum.Top
Doc.Body.Children.Add(rt)
Doc.Preview

 

http://www.foxtable.com/help/topics/2050.htm

 


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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2014/4/9 11:43:00 [显示全部帖子]

以下是引用ndxfke在2014-4-9 11:30:00的发言:
感谢...

确认下,是不是只是针对,合并了cells(0,0)这个单元格,的时候一定要指定模式。

其它单元格有合并时,可选择性指定模式呢?



 

一般都指定一下吧,因为有遇到跨页的情况;文本视情况而定,如果是图片的话,一定要指定。


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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2014/4/9 13:49:00 [显示全部帖子]

以下是引用ndxfke在2014-4-9 13:13:00的发言:
回头来一想,您是怎么测试的呢。

我用 messagebox 调试不出来...

 

先用messagebox调试,然后,部分注释代码调试,慢慢就知道哪里错了,再查原因。


 回到顶部