Is this possible? I am trying to access the global variables via custom code.
However I get this msg when I use the following code.
Public Shared Function Hello() As String
Return Globals.UserID
End Function
ERROR :- There is an error on line 1 of custom code: [BC30469] Reference to
a non-shared member requires an object reference.
I need to get the global variables Execution time, Page Number within the
body to format the report appropriatly.
Thanks in advance to helpers !In order to access the Global (or parameter for that matter) you have to
fully qualify it in the code window.
There are two fixes to your problem.
1. drag a text box to the report area
2. past something like this into it:
=Globals!PageNumber & " of " & Globals!TotalPages
3. run the report.
--
OR (doing it by ref from the code)
--
if you need to ref them from the code, the you have to declare them first in
your code like so:
Function pn()
Dim pn as String
pn = Report.Globals!PageNumber
Return pn
End Function
Function tp()
Dim tp as String
tp = Report.Globals!TotalPages
Return tp
End Function
----
Once you have that in the code window, you can type:
=Code.pn()
or
=Code.tp()
--
to get the pagenumber or total page global respectfully
"d pak" wrote:
> Is this possible? I am trying to access the global variables via custom code.
> However I get this msg when I use the following code.
> Public Shared Function Hello() As String
> Return Globals.UserID
> End Function
> ERROR :- There is an error on line 1 of custom code: [BC30469] Reference to
> a non-shared member requires an object reference.
> I need to get the global variables Execution time, Page Number within the
> body to format the report appropriatly.
> Thanks in advance to helpers !
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment