Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Images not displayed Post Reply Post New Topic
Author Message
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Topic: Images not displayed
     Posted: 13 Dec 2007 at 7:00am

Hi

I have a report which has images to be displayed.
 
Scenario
 
One Main Report
Three Sub Reports
 
Main Report has 2 images header and footer which is reterived from database and displayed properly
 
In subreport the same images are used ,but when the subreport doesnot return any data the images are not displayed Angry......
 
Any ideas why is the happening
 
Crystal Reports version XI release2 Database SQL SERVER 2000
 
Rahul 
IP IP Logged
Lugh
Senior Member
Senior Member
Avatar

Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
Quote Lugh Replybullet Posted: 14 Dec 2007 at 5:42am
When you say the images are "retrieved from database," do you mean the images themselves are stored as BLOBs in the database?  In that case, the answer is fairly obvious, even though the solution may not be.  When the subreport returns no data, there are no records returned.  Meaning, there is no record with the image data returned.

There are a couple solutions to this.  One is to make the join that adds the image data to the query an outer join, so that image data is always returned.  This is probably your best solution, but may get tricky if you have other outer joins in complicated relationships. 

Another option is to actually put the image data in a "dummy" record that is joined to the rest of the query with a UNION ALL statement.  If the image data is not linked to the rest of the data (e.g., a corporate logo, as opposed to, say, the image of a part), then actually remove  the join to the image data from the main query.  Leave the columns in the SELECT statement, but feed them with dummy data (preferably NULL, the empty string, or 0 if numeric).  After the main query, put UNION ALL (this is like UNION, except that it doesn't sort the data together or remove duplicates, and you don't need that overhead).  Create a SELECT statement with dummy data for all of your columns from the main query (the UNION statement requires that the datasets from both queries have the exact same schema), and pulls in the image data you want.  (NOTE:  Make sure to suppress this dummy data in the report itself.)


IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 17 Dec 2007 at 7:18am

Hi,

Yes the images are stored as BLOB in database,Also the images table is not related to subreport data ....as they are just company logos which needs to be displayed in headers....
 
So if i store them in CR repository the crystal file size increases so database option.....
Thanks
Rahul
IP IP Logged
Lugh
Senior Member
Senior Member
Avatar

Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
Quote Lugh Replybullet Posted: 17 Dec 2007 at 11:40am
Yeah, personally, I'd go with the UNION ALL solution I mentioned above.  It's complicated, and potentially finicky, but I think it will give you what you need if you can get it working right.


IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum