all groups > sql server reporting services > august 2005 >
You're in the

sql server reporting services

group:

hide a database image when there is no image in database



hide a database image when there is no image in database ** Spirits **
8/23/2005 11:00:03 PM
sql server reporting services: well i ve an image field in database and then using an image in a
report that is connected with the image database field (carrying image
details in bits) what i want is to hide the image in report when the
image field in database is null (image database field is 0x00 when it
contains NO IMAGE)
i m trying to put following expression in the HIDDEN property of the
IMAGE in the report :
=iif(Fields!image.value=NOTHING,true,false)

but it says that this expression cant b put probably (rather surely)
coz of the datatype of image database field (BIT) so plz help me out
how to do that i ve also tried
iif ( isnothing(Fields!image.value)=NOTHING,true,false)
then it doesnt give error but it always return NON-NULL VALUE (ie
always returns false part of the expression) even the image database
field is EMPTY is (0x00)
how to resolve that issue any suggestion
thanx in advance
Re: hide a database image when there is no image in database Geoff R G Williams
9/22/2005 12:00:00 AM
Hey Spirits,

How about changing your SQL query to something like this:

SELECT imgImage, CASE WHEN imgImage IS NULL THEN 0 ELSE 1 END AS
bitImageExists
FROM tblSomethingImage

And then set the Hidden expression for the image to
"=IIf(Fields!bitImageExists.Value = 1, False, True)"?

Cheers,

-Geoff R G Williams
Primal Blaze Ltd.


[quoted text, click to view]

Re: hide a database image when there is no image in database ** Spirits **
9/29/2005 9:18:36 PM
geoff thanx for concern actually the solution u provided wont work as
i ve tried that n then i got another solution to my problem n i m
sharing it with u it is as followed

well in sql server there is a function named DATALENGTH(ImageDataField)

and returns no of bytes occupied by the image
u should use this to check how many bytes r of a pic better to make a
calculated field in ur data set
then use this calculated field to hid or show the image in the report
by using the following expression in the HIDDEN property of the IMAGE
=iif(imagelengthfield.value=1,true,false)
when image wont b avaiable ur this calculated field ll return 1
otherwise some bigger value representing bytes of the image
u can further go to restrict data set by using
datalength(imageDatabaseField)>1 to come up in the dataset of the
report with the records having images only
choice is urs
take care
regards
AddThis Social Bookmark Button