Problems with DBImage
Hi guys,
we use the DBImage component and load a picture out of a BLOB field.
If there is no picture in the DBImage component the Detailband below the
DBImage should be push upwards.
If we set the property "AutoSize" to True, it works fine.
But the Image should have a fixed size.
we use the DBImage component and load a picture out of a BLOB field.
If there is no picture in the DBImage component the Detailband below the
DBImage should be push upwards.
If we set the property "AutoSize" to True, it works fine.
But the Image should have a fixed size.
This discussion has been closed.
Comments
If you set the image to AutoSize, it will, by definition, re-size itself
to the original width and height when it is loaded from the DB.
If you need a fixed size image but would still like the band to shrink
when no image is present, I suggest checking the DB field value before
the band prints and toggling the visibility of the image component based
on that information.
DBImage.Visible := Report.DataPipeline['ImageField'] = null;
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Hi Nico,
we got a blank report with just a DBImage and a Label in the Detailband.
Only the property AutoDisplay and stretch is enable.
The Detailband set to DynamicHeight.
This is the procedure we are using:
procedure ReportBeforePrint;
begin
DBImage1.Visible := dbPipeline1['Bild'] = null;
end;
But if a image is blank, the band does not shrink.
We use RB Bersion 14.08 Build 48
It appears you are using RAP. If so, you need to check the IsNull
routine rather than comparing to NULL.
Also your code is setting visible to True if the image is NULL. You
need to reverse this.
DBImage1.Visible := not(dbPipeline1['Bild'].IsNull);
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com