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

DisplayFormat DBText component

edited May 2005 in General
Hi,

Why isn't the displayformat picked up from the underlying
field/pipelinefield when a new DBText is dropped on a report. Both
DataSetFields displayformat and DBPipelineFields are set, but still if I
drop a DBText component on a report and set both its pipeline and fieldname
it stays empty. Am I missing something or does a DBTexts displayformat
always have to be set manually? You can't expect a typical user who sells
oranges by the kilo to know he has to set '#,0.00;(#,0.00)' in the
displayformat to get what he's expecting...

Greetings,
Filip Moons

Comments

  • edited May 2005
    Hi Filip,

    The display format is determined based on the datatype of the field that is
    being displayed. This is all done in the ppDisplayFormat.pas file. If you
    would like to customize the way ReportBuilder handles individual datatypes,
    you can easily descendend from the TppDisplayFormat class.



    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited May 2005
    Hi Nico,

    Extending a list doesn't solve anything. with given isn't an option here. It
    depends on the field as object not the datatype. fi. sometimes a FloatField
    has to be represented as a percentage sometimes as a value both having a
    different displayformat. I really don't understand when displayformat are
    set both on Tfield and tppfield level why they aren't used as initial
    displayformat. Even more why a tppfield even has a displayformat when it
    isn't used at all?
    We really want this to be done automatically, it would save our customers
    alot of work/headaches, even if it involves changing the ReportBuilder
    sources:
    TField.Displayformat--->TppField.Displayformat--->TppDBText.DisplayFormat
    Could you give us some pointers in what sources where should be changed to
    get process done automatically

    Greetings,
    Filip Moons





  • edited June 2005
    Hello,

    Anybody arround? Some help would be nice...

    Greetings,
    Filip Moons


  • edited June 2005
    Hi Filip,

    Sorry for the delay.

    I am unaware of the TField.DisplayFormat property. Is this a property of a
    descendent to the TField class?

    The TppField.DisplayFormat property is used when manually creating the
    AutoSearch fields and creating a criteria with a data type of dtDate or
    dtDateTime only. This indicates the date format is required by the database
    being used.

    If you would like to take complete control over the output of the data on
    your report, I would recommend using a non-data-aware component and setting
    its text or value property manually. For instance, it would not be too
    difficult to replace all the DBTexts in question with TppLabels and in the
    OnGetText events manually retrieve the value from the database then run it
    through a small formatting method you create before printing it to the
    report.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited June 2005
    Hi,

    a

    TNumericField.DisplayFormat is basically what we need.

    setting

    No, please bare with me for a few moments. I just want this behavior for
    reports who can be changed by the END-USER. In my earlier post I told you
    that the concept of 'DisplayFormat' is unexistant for our end-users and now
    you even go a bit further and expecting the end-user to write some code too
    even...

    If you just could give us some feedback on what RB sources should be changed
    to get process done automatically. I changed the daIBExpress.pas already but
    that was a waste of time since it is only used in RAP i think...

    Greetings,
    Filip Moons

  • edited June 2005
    Hi Filip,

    The daIBExpress.pas file is used exclusively by DADE so if you are looking
    to change the RB source... this could be the place to do it.

    Sorry, I'm still a bit unclear about what exactly you would like to happen.
    For instance when an end user adds a new field to a report in the designer,
    would you like the display format to automatically be assigned based on
    which field is added at that time, or when he/she previews the report? If
    it is the latter, it should not be that difficult to access the TField
    object, retrieve the display format, and apply it to each appropriate DBText
    in the report before it is printed.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited June 2005
    Hi Nico,


    We don't use DADE so no need to change those sources as i initially thought.

    happen.

    Ideal would be when the end user drops a DBText component on a band and
    assigns the pipeline and fieldname or changes pipeline/fieldname for an
    existing DBText component. A that moment i would like to assign the
    displayformat from the ppfield (pipeline/fieldname) to the displayformat for
    the DBText component. In this case he can still invoke the default
    DisplayFormatList by the right click if he wants it changed to somewhat
    else. So i think we need to change the sources where the ppfields for a
    pipeline is build and when assigning/changing pipeline and/or fieldname for
    a giving DBText component.

    Greetings,
    Filip Moons

  • edited June 2005
    Hi Filip,

    Would it be possible to use the TppDesigner.OnCreateComponent and
    OnAssignField events to retrieve the display format of the TField object and
    assign it to the DisplayFormat property of the DBText? The
    OnCreateComponent event was included to initialize report components as the
    end-user creates them and the OnAssignField evnet was included to initialize
    data-aware report components when their pipeline is assigned.

    --
    Regards,

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

    Best Regards,

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