以文本方式查看主题

-  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=13692)

--  作者:pyh6918
--  发布时间:2011/10/23 12:33:00
--  自定义设置专业报表文本位置?

Dim h As Row=Tables("表1").Current
Dim doc As New PrintDoc \'定义一个报表
Doc.PageSetting.BottomMargin = 10 \'设置下边距

Dim rt As New prt.RenderText \'文本对象
rt.Text = h("负责人") \'文本内容
rt.Style.Font = New Font("仿宋_GB2312", 16) \'设置字体
rt.X=h("负责人水平")
rt.y=h("负责人垂直")
doc.Body.Children.Add(rt) \'加入到报表

doc.Preview() \'预览

 

这段代码出现下列错误提示:


图片点击可在新窗口打开查看此主题相关图片如下:qq截图20111023122343.bmp
图片点击可在新窗口打开查看
如果把:

rt.X=h("负责人水平")
rt.y=h("负责人垂直")

改成:

rt.X=1

rt.y=3

可以。为什么?


--  作者:pyh6918
--  发布时间:2011/10/23 12:38:00
--  
h("负责人水平") 类型是"短整数"
[此贴子已经被作者于2011-10-23 12:40:02编辑过]

--  作者:狐狸爸爸
--  发布时间:2011/10/23 12:50:00
--  
做个例子传上来。
--  作者:pyh6918
--  发布时间:2011/10/23 12:58:00
--  

例子:

 

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

 


--  作者:czy
--  发布时间:2011/10/23 13:28:00
--  

例子最好是商业版的。

[此贴子已经被作者于2011-10-23 13:28:48编辑过]

--  作者:czy
--  发布时间:2011/10/23 13:33:00
--  

要不这样改一下

 

Dim h As Row=Tables("表A").Current
Dim x As Integer = h("第二列")
Dim y As Integer = h("第三列")
Dim doc As New PrintDoc \'定义一个报表
Doc.PageSetting.BottomMargin = 10 \'设置下边距

Dim rt As New prt.RenderText \'文本对象
rt.Text = h("第一列") \'文本内容
rt.Style.Font = New Font("仿宋_GB2312", 16) \'设置字体
rt.x = y
rt.y = x
doc.Body.Children.Add(rt) \'加入到报表

doc.Preview() \'预览


--  作者:czy
--  发布时间:2011/10/23 13:35:00
--  

 

Dim h As Row=Tables("表A").Current
Dim doc As New PrintDoc \'定义一个报表
Doc.PageSetting.BottomMargin = 10 \'设置下边距

Dim rt As New prt.RenderText \'文本对象
rt.Text = h("第一列") \'文本内容
rt.Style.Font = New Font("仿宋_GB2312", 16) \'设置字体
rt.x = Val(h("第二列"))
rt.y = Val(h("第三列"))
doc.Body.Children.Add(rt) \'加入到报表

doc.Preview() \'预览


--  作者:pyh6918
--  发布时间:2011/10/23 14:05:00
--  

多谢,可以了。

 

不懂,为什么还要转换一下那?