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

How to insert the correct component via drag and drop depending on the datatype?

edited October 2009 in General
Hello,
I have some blob fields in my DataSet, where RichText is stored in. In the
pipeline it's a memo-type field - the same as a "normal" blob field, i.e.
plain text.
If I drag such a field from the DataTree into the template I'm designing,
then a DBMemo gets added, not a DBRichText, so I have to replace the
component manually.

My question is:
is there any way to determine the "real" type of a memo-filed and to insert
either a DBMemo or a DBRichText depending an that type?

Comments

  • edited October 2009
    Hi Mark,

    This is not currently a feature of the DataTree Window.

    The DataTree uses the TppLayoutFactory (ppRptWiz.pas) class to determine
    which component is created for a given field. This class is completely
    replacable so it would be possible for you to create your own LayoutFactory
    that adds some functionality to check to see if a memo field contains
    RichText code. Take a look at the CreateComponentForField and
    DataTypeToComponentClass routines specifically.

    To replace the existing LayoutFactory you would simply assign your own to
    the gcLayoutFactory variable.

    Moving forward, this would be a nice feature and is something we will
    consider adding to a later release of ReportBuilder.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2009
    Hi Nico,
    sounds good about a possible implementation of this feature!

    Also thank you for the tip how it could be done. I will take a look into it,
    I think.

    Mark

This discussion has been closed.