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. 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 bodiy of
the report.
Below is a sample of the embedded code.
Function VisibleYN(subject as string,passedyn as boolean) as double
if subject = "Math" and passedyn = true then
mathimage.visibility = visible
end if
if subject = "Science" and passedyn = true 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!
--
MarieThe actual property is under the visibility and is named "IsHidden", so your
function should return a boolean rather than try and set a property.
Change
mathimage.visibility = visible
to
Return False
and likewise for your science one to get it to work.
"Marie" wrote:
> 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. 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 bodiy of
> the report.
> Below is a sample of the embedded code.
> Function VisibleYN(subject as string,passedyn as boolean) as double
> if subject = "Math" and passedyn = true then
> mathimage.visibility = visible
> end if
> if subject = "Science" and passedyn = true 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|||The reason I am trying to set the property is because the function is being
called from a textbox bound to a field. Based on the value in the field I am
setting the property of a checkmark image. If I return the boolean value how
do I use this value to set the property of another report item? I was hoping
I could do something like Reportitem.image1.ishidden = false.
Any suggestions?
Thanks for your help.
--
Marie
"David Swanson" wrote:
> The actual property is under the visibility and is named "IsHidden", so your
> function should return a boolean rather than try and set a property.
> Change
> mathimage.visibility = visible
> to
> Return False
> and likewise for your science one to get it to work.
> "Marie" wrote:
> > 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. 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 bodiy of
> > the report.
> >
> > Below is a sample of the embedded code.
> >
> > Function VisibleYN(subject as string,passedyn as boolean) as double
> > if subject = "Math" and passedyn = true then
> > mathimage.visibility = visible
> > end if
> > if subject = "Science" and passedyn = true 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|||You can use an expression for the hidden property of the image in the report.
Right click on the image, expand Visibility, then use this in the Hidden
property
=TextBox1.Value="Math"
or
=iif(textBox1.Value="Math",true,false)
I was looking for something similar the other day, and I found the custom
code is a little quirky because I could not find a way to access control
members via code.
When I passed Me as an object, I got some interesting results. For example,
try
this:
function Test(me as object) as boolean
msgbox("String=" & Me.ToString)
return false
end sub
TextBox9.Value=Code.Test(me)
Check out the title of the msgbox itself! It looks like there is funcky
name mangling going on in the host, which prevents us from using objects
directly in custom code.
msgbox("Name=" & Me.Name) indicates a public member not available, so it
appears that unless there is a reflection trick, I have yet to find a way to
access member variables of a report control in custom code.
I'll keep an eye on this thread, and I hope this is of some help to you..
Dwayne
Showing posts with label image. Show all posts
Showing posts with label image. Show all posts
Thursday, March 8, 2012
Wednesday, March 7, 2012
Conditional Image in Page Header
I have an image defined as:
="http://server.name.com/images" & IIf((Left(First(Fields!logo_url.Value,
"DeploymentDeliveryHeader"),1) = "/"),First(Fields!logo_url.Value,
"DeploymentDeliveryHeader"),"/BlueBar_withGraphic.gif")
I want to move this image to the report header. But am getting a message
stating that Fields cannot be used in report headers or footers. I think I
can hide it in the report and reference it in the header. But I don't know
how to reference an image.
Anyone know how to get an image in a header?Stephanie,
Can you store the path to the image in a hidden textbox in the body of the
report, then your image in the header will refer to the textbox for it's
image source value.
Make sense?
--
Andy Potter
blog : http://sqlreportingservices.spaces.live.com
info@.(NOSPAM)lakeclaireenterprises.com
"Stephanie" <Stephanie@.discussions.microsoft.com> wrote in message
news:88A98827-774E-44F6-87B2-1B39A9544C7F@.microsoft.com...
>I have an image defined as:
> ="http://server.name.com/images" & IIf((Left(First(Fields!logo_url.Value,
> "DeploymentDeliveryHeader"),1) = "/"),First(Fields!logo_url.Value,
> "DeploymentDeliveryHeader"),"/BlueBar_withGraphic.gif")
> I want to move this image to the report header. But am getting a message
> stating that Fields cannot be used in report headers or footers. I think
> I
> can hide it in the report and reference it in the header. But I don't
> know
> how to reference an image.
> Anyone know how to get an image in a header?|||Yes, makes sense and I just did that. The report is not erroring out now
(yea!) but the image is blank. This has got to be something people do on a
regular basis, isn't it? I don't want an embedded image because the image
changes based on the database the report is run against.
Any other suggestions on how to put an external image in a page header?
"Andy Potter" wrote:
> Stephanie,
> Can you store the path to the image in a hidden textbox in the body of the
> report, then your image in the header will refer to the textbox for it's
> image source value.
> Make sense?
> --
> Andy Potter
> blog : http://sqlreportingservices.spaces.live.com
> info@.(NOSPAM)lakeclaireenterprises.com
> "Stephanie" <Stephanie@.discussions.microsoft.com> wrote in message
> news:88A98827-774E-44F6-87B2-1B39A9544C7F@.microsoft.com...
> >I have an image defined as:
> > ="http://server.name.com/images" & IIf((Left(First(Fields!logo_url.Value,
> > "DeploymentDeliveryHeader"),1) = "/"),First(Fields!logo_url.Value,
> > "DeploymentDeliveryHeader"),"/BlueBar_withGraphic.gif")
> >
> > I want to move this image to the report header. But am getting a message
> > stating that Fields cannot be used in report headers or footers. I think
> > I
> > can hide it in the report and reference it in the header. But I don't
> > know
> > how to reference an image.
> >
> > Anyone know how to get an image in a header?
>
>|||Nevermind my last reply. I tried it again and it worked just fine. THANK YOU!
Stephanie ; )
"Andy Potter" wrote:
> Stephanie,
> Can you store the path to the image in a hidden textbox in the body of the
> report, then your image in the header will refer to the textbox for it's
> image source value.
> Make sense?
> --
> Andy Potter
> blog : http://sqlreportingservices.spaces.live.com
> info@.(NOSPAM)lakeclaireenterprises.com
> "Stephanie" <Stephanie@.discussions.microsoft.com> wrote in message
> news:88A98827-774E-44F6-87B2-1B39A9544C7F@.microsoft.com...
> >I have an image defined as:
> > ="http://server.name.com/images" & IIf((Left(First(Fields!logo_url.Value,
> > "DeploymentDeliveryHeader"),1) = "/"),First(Fields!logo_url.Value,
> > "DeploymentDeliveryHeader"),"/BlueBar_withGraphic.gif")
> >
> > I want to move this image to the report header. But am getting a message
> > stating that Fields cannot be used in report headers or footers. I think
> > I
> > can hide it in the report and reference it in the header. But I don't
> > know
> > how to reference an image.
> >
> > Anyone know how to get an image in a header?
>
>
="http://server.name.com/images" & IIf((Left(First(Fields!logo_url.Value,
"DeploymentDeliveryHeader"),1) = "/"),First(Fields!logo_url.Value,
"DeploymentDeliveryHeader"),"/BlueBar_withGraphic.gif")
I want to move this image to the report header. But am getting a message
stating that Fields cannot be used in report headers or footers. I think I
can hide it in the report and reference it in the header. But I don't know
how to reference an image.
Anyone know how to get an image in a header?Stephanie,
Can you store the path to the image in a hidden textbox in the body of the
report, then your image in the header will refer to the textbox for it's
image source value.
Make sense?
--
Andy Potter
blog : http://sqlreportingservices.spaces.live.com
info@.(NOSPAM)lakeclaireenterprises.com
"Stephanie" <Stephanie@.discussions.microsoft.com> wrote in message
news:88A98827-774E-44F6-87B2-1B39A9544C7F@.microsoft.com...
>I have an image defined as:
> ="http://server.name.com/images" & IIf((Left(First(Fields!logo_url.Value,
> "DeploymentDeliveryHeader"),1) = "/"),First(Fields!logo_url.Value,
> "DeploymentDeliveryHeader"),"/BlueBar_withGraphic.gif")
> I want to move this image to the report header. But am getting a message
> stating that Fields cannot be used in report headers or footers. I think
> I
> can hide it in the report and reference it in the header. But I don't
> know
> how to reference an image.
> Anyone know how to get an image in a header?|||Yes, makes sense and I just did that. The report is not erroring out now
(yea!) but the image is blank. This has got to be something people do on a
regular basis, isn't it? I don't want an embedded image because the image
changes based on the database the report is run against.
Any other suggestions on how to put an external image in a page header?
"Andy Potter" wrote:
> Stephanie,
> Can you store the path to the image in a hidden textbox in the body of the
> report, then your image in the header will refer to the textbox for it's
> image source value.
> Make sense?
> --
> Andy Potter
> blog : http://sqlreportingservices.spaces.live.com
> info@.(NOSPAM)lakeclaireenterprises.com
> "Stephanie" <Stephanie@.discussions.microsoft.com> wrote in message
> news:88A98827-774E-44F6-87B2-1B39A9544C7F@.microsoft.com...
> >I have an image defined as:
> > ="http://server.name.com/images" & IIf((Left(First(Fields!logo_url.Value,
> > "DeploymentDeliveryHeader"),1) = "/"),First(Fields!logo_url.Value,
> > "DeploymentDeliveryHeader"),"/BlueBar_withGraphic.gif")
> >
> > I want to move this image to the report header. But am getting a message
> > stating that Fields cannot be used in report headers or footers. I think
> > I
> > can hide it in the report and reference it in the header. But I don't
> > know
> > how to reference an image.
> >
> > Anyone know how to get an image in a header?
>
>|||Nevermind my last reply. I tried it again and it worked just fine. THANK YOU!
Stephanie ; )
"Andy Potter" wrote:
> Stephanie,
> Can you store the path to the image in a hidden textbox in the body of the
> report, then your image in the header will refer to the textbox for it's
> image source value.
> Make sense?
> --
> Andy Potter
> blog : http://sqlreportingservices.spaces.live.com
> info@.(NOSPAM)lakeclaireenterprises.com
> "Stephanie" <Stephanie@.discussions.microsoft.com> wrote in message
> news:88A98827-774E-44F6-87B2-1B39A9544C7F@.microsoft.com...
> >I have an image defined as:
> > ="http://server.name.com/images" & IIf((Left(First(Fields!logo_url.Value,
> > "DeploymentDeliveryHeader"),1) = "/"),First(Fields!logo_url.Value,
> > "DeploymentDeliveryHeader"),"/BlueBar_withGraphic.gif")
> >
> > I want to move this image to the report header. But am getting a message
> > stating that Fields cannot be used in report headers or footers. I think
> > I
> > can hide it in the report and reference it in the header. But I don't
> > know
> > how to reference an image.
> >
> > Anyone know how to get an image in a header?
>
>
Subscribe to:
Posts (Atom)