Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
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.)
Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
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.....
Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
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.
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