Foxtable(狐表)用户栏目专家坐堂 → 自定义动态函数问题


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

主题:自定义动态函数问题

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


加好友 发短信
等级:童狐 帖子:282 积分:2835 威望:0 精华:0 注册:2019/4/23 11:17:00
自定义动态函数问题  发帖心情 Post By:2019/12/31 12:51:00 [显示全部帖子]

Dim Code As string
Code
 = "Dim Val1 As Integer = 1" & vbcrlf
Code
 = Code & "Dim Val2 As Integer = 2" & vbcrlf
Code
 = Code & "Dim Sum As Integer = Val1 + Val2" & vbcrlf
Code
 = Code & "Return Sum"
Functions.Add(
"Sum",Code)
Functions.Complie()

--帮助里的代码 在命令窗口执行 下面的 没有反应啊,


Functions.Execute("Sum")


可以将专业报告里的字符定义做成 这种吗,在函数里 生成动态命令 在报表里生成吗,例如

Dim Code As string
Code
 = "Dim rtitle As New prt.RenderText " & vbcrlf
Code
 = Code & ".Text = ""苏州精准医疗科技有限公司""" & vbcrlf
Code
 = Code & "x=val(doc.PageSetting.Width)/2 - val(.Width)/2" & vbcrlf
 
Functions.Add(
"pr",Code)
Functions.Complie(pr
)


 

 


 回到顶部