Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Problems with DBImage

edited September 2013 in General
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.

Comments

  • edited September 2013
    Hi David,

    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;

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited September 2013
    Am 11.09.2013 17:24, schrieb Nico Cizik (Digital Metaphors):


    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
  • edited September 2013
    Hi David,

    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);

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.