thayduck
asked on
SSRS 2008 Report Code Not Working
Below Report code not working. Found it on the internet.
I am trying to find if my report is on page 1 or not so I can control the printing of a line thru-out report.
Public Shared Function PageOn (ByVal PageNumber() as string) as string
Dim str as string
If Globals!PageNumber = 1 then str = "False"
Else str = "True"
End If
Return str
End Function
In report and using for line visibility:
=iif(code.PageOn = False,False,True)
Error:
Reference to a non-shared member requires an object reference.
If there is a better way to write this code and it works, I'm in...
I am trying to find if my report is on page 1 or not so I can control the printing of a line thru-out report.
Public Shared Function PageOn (ByVal PageNumber() as string) as string
Dim str as string
If Globals!PageNumber = 1 then str = "False"
Else str = "True"
End If
Return str
End Function
In report and using for line visibility:
=iif(code.PageOn = False,False,True)
Error:
Reference to a non-shared member requires an object reference.
If there is a better way to write this code and it works, I'm in...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Below Custom Code works, but , =IIF(code.PageNumber() = 1, False,True) always shows False no matter what page report is on. code.PageNumber() is always 1.
Public Function PageNumber() as string
Dim str as String
str = me.Report.Globals!PageNumb er.ToStrin g()
Return str
End Function
Public Function PageNumber() as string
Dim str as String
str = me.Report.Globals!PageNumb
Return str
End Function
ASKER
Visibilty Line code I am using this Report Custom Code on:
=IIF(code.PageOn = "False", False,True)
PageOnError.PNG