Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
miriv365
Starting Member
3 Posts |
Posted - 2005-04-18 : 11:20:59
|
I have a crystal report that I am having to convert over to SQL reporting services. In the Crystal report, I am able to programatically show/hide texboxes, however, I am running into a problem doing the same thing in SQL Reporting services. I have two textboxes side by side. One textbox is just a description of what is going to be showing in the next textbox along the lines of this1st Textbox 2nd TextboxFormula a2+b2=c2I would like the text in the first box to have visibility of False when there is no value in the second textbox. I am using the following code but get the following error.Public Function ShowBox() as Boolean Dim ReturnValue as Boolean If (Len(Fields!itm_Formula.Value)>0) Then ReturnValue=True Else ReturnValue=False End If Return ReturnValueEnd FunctionIn the Visibility expression section of Textbox1 I am referenceing that code with the following line:=Code.ShowBox()I am getting the following error when trying to run the report[BC30469] Reference to a non-shared member requires an object reference.Can anyone help with this? |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2005-04-18 : 12:47:23
|
I don't think that you can reference a field inside the VB code: Fields!itm_Formula.Value)>0You would have to pass that value into this function in order to be able to use it. But I'm wondering why you are even bothering with this, when you can do this in the expression of that textbox in the hidden property of the visibility attribute.Tara |
 |
|
miriv365
Starting Member
3 Posts |
Posted - 2005-04-18 : 13:06:49
|
I am very new to SQL Reporting Services (5 days to be exact)-- How exactly would I do what you mentioned in your reply? |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2005-04-18 : 13:11:21
|
Highlight the text box that you want to be hidden sometimes, go to the visibility/hidden property. Use an expression:IIf((Len(Fields!itm_Formula.Value)>0), False, True)Tara |
 |
|
miriv365
Starting Member
3 Posts |
Posted - 2005-04-18 : 14:22:22
|
Thanks, that worked great! |
 |
|
|
|
|