以文本方式查看主题 - Foxtable(狐表) (http://www.foxtable.com/bbs/index.asp) -- 专家坐堂 (http://www.foxtable.com/bbs/list.asp?boardid=2) ---- 报表插入图片无效 (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=132366) |
-- 作者:ljh29206 -- 发布时间:2019/3/20 17:04:00 -- 报表插入图片无效 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 = "Parent.Width" \'对象宽度等于页面宽度 rt.Height = 120 \'对象高度等于页面高度 rt.Rows.Count = 2 \'设置行数为2行 rt.Cols.Count = 2 \'设置列数为2列 If FileSys.FileExists("C:\\Users\\pcliujianhua\\Desktop\\sdf.jpg") Then rt.Cells(1,0).Image = GetImage("C:\\Users\\pcliujianhua\\Desktop\\sdf.jpg") Else MessageBox.Show(1) End If rt.Cells(1,1).text = "21321321" ’能输出 doc.Preview() 指定路径不能输出,路径没有问题,请指点
[此贴子已经被作者于2019/3/20 17:07:21编辑过]
|
-- 作者:有点甜 -- 发布时间:2019/3/20 17:18:00 --
我测试,只要图片路径正确,是正常的图片,都没问题。
请认真测试。 |
-- 作者:ljh29206 -- 发布时间:2019/3/20 17:39:00 -- Dim doc As New PrintDoc \'定义一个报表 doc.Body.Children.Add(rt) rt.Style.GridLines.All = New prt.LineDef rt.Width = "Parent.Width" \'对象宽度等于页面宽度 rt.Height = 120 \'对象高度等于页面高度 rt.Rows.Count = 2 \'设置行数为3行 rt.Cols.Count = 2 \'设置列数为3列 If FileSys.FileExists("C:\\Users\\pc\\Desktop\\LCH03.png") Then rt.Cells(0,0).Image = GetImage("C:\\Users\\pc\\Desktop\\LCH03.png") End If If FileSys.FileExists("C:\\Users\\pc\\Desktop\\LCH02.png") Then rt.Cells(0,1).Image = GetImage("C:\\Users\\pc\\Desktop\\LCH02.png") End If If FileSys.FileExists("C:\\Users\\pc\\Desktop\\LCH05.png") Then rt.Cells(1,0).Image = GetImage("C:\\Users\\pc\\Desktop\\LCH05.png") End If \'---------------------------图片 rt.Cells(1,1).text = "21321321" ’能输出 doc.Preview() 甜版 我测试结果很奇怪 4个单元格 中 的3个放置图片进去 ,连续试几次,发现 只能随机输出 2个 或者 1 个 不能全部输出。 是我电脑问题还是foxtable问题! |
-- 作者:有点甜 -- 发布时间:2019/3/20 17:43:00 -- 我测试代码没问题。请做一个对应实例发上来测试,图片也要发上来。 |
-- 作者:ljh29206 -- 发布时间:2019/3/20 17:46:00 -- 重新打开了就没问题了,比较奇怪! |