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

Problem with empty dataset

edited August 2002 in General
I've experienced strange behaviour when I run my application to generate
report with no records.
Whenever I try to generate report with TQuerys that have SQL statement
count(*) and there is no
record, it'll display the following error message.
Type dismatch for field 'MyCount', expecting: Float actual: Integer'.
However, if there are records in that table, everything works fine.

There's also some strange behaviour in Delphi. When I use the Field Editor
of TQuery to add data
fields, the field "MyCount" will always be set to TFloatField while I think
it should be an integer field.

Since I don't know whether it's related to the ReportBuilder or Delphi
itself so I'll post the problem
on both newsgroups. I'm looking forward for any syggestions.

I'm using ReportBuilder 6.03 with Delphi 5 on Windows ME platform.

Thank you.

Comments

  • edited August 2002
    Your event handler is firing for the report. The report will try to
    generate an empty report. You can control the behavior of the report by
    setting the Report.NoDataBehaviors property. You can also place a check in
    your event handler calculation to not calculate if ppdaNoRecords is in the
    DataPipeline.State property. Add ppTypes to the uses clause to get
    ppdaNoRecords recognized by the compiler.


    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.