Embedded Custom Code

  • I am trying to create a embedded function that will accept a dataset field value and based on the value make an image visibility hidden or visible in the body of the report. Below is a sample of the embedded code.

    Function VisibleYN(subject as string,passedyn as boolean) as  double

    if subject = "Math" then

       mathimage.visibility = visible

    end if

    if subject = "Science" then

       scienceimage.visibility = visible

    end if

    THe following expression is in the visibility property tab of the textbox that holds the subject.

    code.visibleyn(fields!subject.value as string, passedyn as boolean)

    Any help would be appreciated!

    Marie

  • Sorry I forgot to mention the error I am received.

    I receive an error that the mathimage is not declared. How do I reference an image in the body of the report. The field is within a list and based on the subject an image is displayed in the body of the report.

  • try this code:

    Public Shared Function VisibleYN(ByVal Value As String) As Boolean

     if subject = "Math" then

       VisibleYN= True

    else

    VisibleYN=False

    end if

    if subject = "Science" then

       VisibleYN= True

    else

    VisibleYN=False

    end if

    End Function

    Then on mathimage.visibility u set the hidden property=code.VisibleYN(fields!subject.value)

  • There is a list of images (checkmarks) in the body of the report. THe databound textbox control that is evaluating whether the image should be visible is contained in a list. Based on the value in the textbox I would like to make the approriate image(checkmark) visible. Can I reference a report item in the body of the report to  do something like reportitem.image.visible = true? If so how?

    Your help is appreciated.

    Marie

    PS. It would really be great if report services had a checkbox control!

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply