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

Display format lost

edited November 2002 in End User
Hello,

Environment:

ReportBuilder 7.0

Delphi 6.02

IBX 6.04

In Data Tab I create a calculate field sum (TRQTY) being TRQTY dtInteger
like in the following SQL:

SELECT TRAZAB_1.TrArt, SUM(TRAZAB_1.TrQty) SUM_TRAZAB_1_TrQty

FROM TRAZAB TRAZAB_1

GROUP BY TRAZAB_1.TrArt

In data Tab I can see that the field type is LargeInt which makes that in
Design mode I can't see different examples for Display Format.

If I put a DBCalc of this field in Summary Band this field is not
calculated.

In ReportBuilder 6.03 the field is LongInt and it works perfect.

Do you know why the field is marked as LargeInt? Should I define LargeInt in
some place?

Thanks,

Jose Maria Sanmartin

Comments

  • edited November 2002
    I'm not able to reproduce the problem. I created an integer field in the
    dataview and then created a calc field on it. The type was integer. What is
    the data type of the column in your database? Drop an IBQuery on the form
    and connect to the table and create the same query. You can then examine the
    field objects on the dataset. In DADE, RB gets the data types by asking the
    IBQuery that it creates internally. In your test, what does Delphi think
    the field type of this column of data is? Does it come back as ftLargeInt or
    ftInteger? You can look in RBuilder\Source\ppDBPipe.pas for the
    ppConvertFieldType method to see what we convert the field data type to.


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited November 2002
    Jim,

    The field in Interbase is SmallInt. If I drop an IBQuery on the form
    creating the same query the field appears as TLargeIntField in both
    ReportBuilder 6.03 and 7.00. But in ReportBuilder 6.03 appears as LongInt
    and 7.00 as LargeInt.

    It seems that ReportBuilder doesn't recognize LargeInt as numeric.

    Meanwhile, I'll have a look to ppDBPipe.pas and try to reproduce the
    error.

    Thanks,

    Jose Maria Sanmartin

  • edited November 2002
    Jim,



    I can reproduce the problem.



    1.- Prepare the employee.gdb with ReportBuilder tables
    running in IBConsole CreateEndUserTables.sql



    2.- Change in IBConsole the SQLDialect from 1 to 3



    3.- Open EndUser project from Rbuilder\Demos\Interbase\IB
    Express



    4.- Change EuDatabase.SQLDialect from 1 to 3



    5.- Compile & run the project



    6.- Create a new report with the following data



    SELECT JOB_1.JOB_CODE,

    SUM(JOB_1.JOB_GRADE) SUM_JOB_1_JOB_GRADE

    FROM JOB JOB_1

    GROUP BY JOB_1.JOB_CODE



    7.- As you can see the field appears as LargeInt.



    8.- Putting the field in Design mode the Display Format
    doesn't show any format although the data is showed.If you put a Sum of this
    field in the foot, it always show 0.



    Please, let me know if you can reproduce know.



    Thanks,





    Jose Maria Sanmartin
  • edited November 2002
    Works fine if you don't set the SQL dialect to 3 and leave it at the
    default. What I did was see what Delphi said the field type was. It says it
    is ftLargeInt. I dropped the SQL in a IBQuery on a form. Then checked the
    field object at runtime. RB is simply relying on the field type being
    returned. It has no way of converting it the type other than the default
    conversion code we have for all types that I posted previously.

    procedure TmyEndUserSolution.Button1Click(Sender: TObject);
    var
    lField: TField;
    begin

    lField := IBQuery1.Fields[1];

    ShowMessage(IntToStr(Ord(lField.DataType)));

    end;

    However, all you want to do is show the display format. This can be done.
    When it is a large integer type, RB doesn't show any display format.

    The code is missing a check for large integer.You can add one for ftLargeInt
    in the case statement. You can modify this line

    dtInteger, dtSingle, dtDouble, dtExtended, dtCurrency, dtLongint,
    dtLargeInt:

    in ppDisplayFormat.pas in TppDisplayFormat.GetDisplayFormats and it will
    begin working or you can replace the display formats as shown in this demo:

    http://www.digital-metaphors.com/tips/ReplaceDisplayFormats.zip

    This has been fixed for the next release.

    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited November 2002
    Jim,

    Thanks for your fast solution.

    This fixes the problem of the display format but it doesn't not fix the
    problem of step 8.

    Putting a dbCalc of this field in Summary Band with Calc type sum,
    Report Builder always shows 0 so it doesn't sum.

    Can you reproduce it?

    Thanks again for your great support.

    Regards,

    Jose Maria Sanmartin



  • edited November 2002
    Yes, but I haven't resolved the second issue yet. Thankyou for your
    patience.


    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.