Nat*_*itt 4 sql-server-2005 reportingservices-2005 reporting-services
我需要在报告首次加载时执行自定义代码功能,我需要它只运行一次.我把它放在哪里?
我不确定如何做到这一点的最佳方式.我认为你没有得到任何事件,但你可以捏造它.例如,让标题调用一个函数来设置标题,并作为副产品调用您的自定义代码函数一次:
Public Dim ReportTitle As String = ""
Public Function GetTitleAndDoSomethingElse As String
If (ReportTitle = "") Then
ReportTitle = "My Report Title"
' Do your stuff that runs once here
End If
Return ReportTitle
End Function
Run Code Online (Sandbox Code Playgroud)
然后在您的报表标题中有一个文本框,设置为:
=Code.GetTitleAndDoSomethingElse
Run Code Online (Sandbox Code Playgroud)
丑陋,但应该做的伎俩.