Wrox Programmer Forums
|
BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7
This is the forum to discuss the Wrox book Professional SQL ServerReporting Services by Paul Turley, Todd Bryant, James Counihan, George McKee, Dave DuVarney; ISBN: 9780764568787
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 18th, 2005, 10:16 AM
Registered User
 
Join Date: Feb 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Programatically Show Hide Textboxes

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 this

1st Textbox 2nd Textbox
Formula a2+b2=c2

I 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 ReturnValue
End Function

In 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?

 
Old April 19th, 2005, 08:08 PM
Registered User
 
Join Date: Mar 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You should pass the field in to the function, not reference the field from the function.

e.g. =Code.ShowBox(Fields!itm_Formula.Value)

Public Function ShowBox(CheckField as String) as Boolean
   Dim ReturnValue as Boolean
    If (Len(CheckField)>0) Then
        ReturnValue=True
    Else
        ReturnValue=False
    End If
    Return ReturnValue
End Function

blowinoil






Similar Threads
Thread Thread Starter Forum Replies Last Post
Hide/Show Desktop icons jpool Visual Basic 2005 Basics 0 July 27th, 2008 02:47 PM
HIDE/SHOW pallone Javascript How-To 11 April 16th, 2007 10:24 AM
how to show/hide forms ? ashrafzia C# 3 November 3rd, 2006 11:07 AM
show/hide row(s) eugz Beginning PHP 0 March 19th, 2006 10:10 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.