Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / Services / Reporting Services / September 2005

Tip: Looking for answers? Try searching our database.

hide a database image when there is no image in database

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
** Spirits ** - 24 Aug 2005 07:00 GMT
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
Geoff R G Williams - 22 Sep 2005 15:05 GMT
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.

> 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
[quoted text clipped - 14 lines]
> how to resolve that issue any suggestion
> thanx in advance
** Spirits ** - 30 Sep 2005 05:18 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.