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

Displayformat property of TppDBPipeline

edited March 2003 in General
Hello All,

When i set Displayformat-property of a field in SQLDataset or ClientDataset,
the field on the TppReport is not printed according to the format i set.

Also when i set the Displayformat-property of a field in the TppDBPipeline
component, the field on the Report is not printed with the format i set.

The only time i get Displayformat working, is to set the DisplayFormat of
the DBText-field on the report itself, in the reportdesigner. I don't want
that, i want to do that work for our users. So our users don't need to know
about displayformats syntax, when they are making their own reports.

Any suggestions what i do wrong?

I'm using Delphi 6 + Reportbuilder 6.03, but i just tried Reportbuild 7.02
to see if the problem still exists in version 7. And it does...

Hope someone has a sollution,
--
Marcel van Bloppoel
Software Engineer
Vendit B.V.

http://www.vendit.nl/

Comments

  • edited March 2003
    This is can be done in code. What you can do is code the
    TppDeigner.OnAssignField event. For this example I used a TQuery on a form
    connecting to DBDemos Orders table for the 'AmountPaid' field which had a
    display format set on the TField object at Delphi design time in the TQuery.

    procedure TmyEndUserSolution.ppDesigner1AssignField(Sender: TObject);
    var
    lField: TField;
    lQuery: TQuery;
    begin

    if (Sender is TppDBText) and (TppComponent(Sender).IsDataAware) then
    begin
    lQuery :=
    TQuery(TppDBPipeline(TppComponent(Sender).DataPipeline).DataSource.Dataset);

    lField := lQuery.FieldByName(TppComponent(Sender).DataField);

    if (lField is TNumericField) then
    TppDBText(Sender).DisplayFormat :=
    TNumericField(lField).DisplayFormat;
    end;

    end;


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited March 2003
    Sorry, I meant TppDesigner.OnAssignField event.

    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.