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)