Sizing problem with DBImage in detail band
Hi,
for our project we have created a report that gets its data from the
devexpress MemData component. The MemData is filled with a list of articles.
Some articles have images (JPEG) that are stored to a TGraphicField
(Blobfield with blobtype = ftGraphic). For articles without photos the
blobfield has a null value. In the detail band we are using a DBImage with
autosize and autodisplay to print the photos.
The problem are the records where the blobfield isn't filled. The height of
the "empty DBImages" depends on the height of the "filled DBImages". Is
there a way to reduce the height of the "empty DBimages" to zero and to show
the "filled DBImages" with the normal height?
We re using Report Builder 9.01...
Thanks,
Alex
for our project we have created a report that gets its data from the
devexpress MemData component. The MemData is filled with a list of articles.
Some articles have images (JPEG) that are stored to a TGraphicField
(Blobfield with blobtype = ftGraphic). For articles without photos the
blobfield has a null value. In the detail band we are using a DBImage with
autosize and autodisplay to print the photos.
The problem are the records where the blobfield isn't filled. The height of
the "empty DBImages" depends on the height of the "filled DBImages". Is
there a way to reduce the height of the "empty DBimages" to zero and to show
the "filled DBImages" with the normal height?
We re using Report Builder 9.01...
Thanks,
Alex
This discussion has been closed.
Comments
when I change the PassSetting of the report to psOnePass everything is fine.
The report engine changes the size of every DBImage with Autosize enabled
and no picture assigned when going through the second pass. Why is that?
does anybody know a solution?
You can toggle the visibility of the DBImage based on whether there is
information in the blob field. Below is the code I used to accomplish this.
procedure TForm1.ppDetailBand1BeforePrint(Sender: TObject);
var
lStream: TMemoryStream;
begin
lStream := TMemoryStream.Create;
try
ppReport1.DataPipeline.GetFieldAsStream('BMP', lStream);
if lStream.Size = 0 then
ppDBImage1.Visible := False
else
ppDBImage1.Visible := True;
finally
lStream.Free;
end;
end;
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com