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

NoDataBehaviors And RAP

edited August 2004 in RAP
I have a end-user/RAP/DADE environment with the TppReport NoDataBehaviors =
[ndMessageOnPage, ndBlankReport]. When the query gives no data, no message
(and no report output) occurs. According to Help, this should output a
message. What am I doing wrong?

In RAP, the Report.OnNoData event shows:

procedure ReportOnNoData(aDialog : TObject; var aShowDialog :boolean;
DrawCommand : TObject; var aAddDrawCommand : Boolean);

begin
aShowDialog :=
aAddDrawCommand :=
end;

Can anyone provide an example of how these are used?

Tom

Comments

  • edited August 2004
    I also should have asked how to cancel the report from within the
    Report.OnNoData event?
  • edited August 2004

    1. In my testing here the NoDataBehaviors property is working correctly.
    Note that this is a published property. Therefore when you load a report
    from .rtm or database, the NoDataBehaviors that were saved with the report
    will be used. You can use the Report.Template.OnLoadEnd event to initialize
    the NoDataBehaviors after a report is loaded. Perhaps that is what you need
    to do here.

    2. The RBuilder.hlp topic for TppReport.OnNoData contains a good
    explaination of how this event is used. The aShowDialog is only applicable
    when NoDataBehaviors includes ndMessageDialog and likewise the a
    aAddDrawCommand is only applicable when NoDataBehaviors includes
    ndBlankReport.

    3. The NoDataBehaviors is not designed to enable a report to be cancelled.


    --

    Nard Moseley
    Digital Metaphors Corporation
    www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited August 2004
    Nard:
    initialize
    need

    The reports are stored in a database (with the NoDataBehaviors property set
    properly). For some reason which I can't determine, they seem to have
    disappeared when the report is reloaded. I discovered that I could set them
    from RAP with a pass-through function called from Report.BeforePrint, which
    gives the proper results (as documented.) I can find no reason that the
    properties as saved are not there when the report is run. Is there anything
    else that I could be doing that would affect them?

    Tom
  • edited August 2004

    I tried a simple example in which I created a report, configured the
    NoDataBehaviors and then save the report to an .rtm. I then changed the
    TppReport.NoDataBehaviors back to the defaults and wrote a Button OnClick
    event-handler to load the .rtm and preview. The NoDataBehaviors saved to the
    .rtm were restored properly.

    Try creating a simple example and if it still is an issue, then send to
    support@digital-metaphors.com in zip format and we can check it out.


    --
    Nard Moseley
    Digital Metaphors Corporation
    www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited August 2004

  • edited August 2004

    Sorry about the empty report - hand was quicker than the brain!

  • edited August 2004

    Aha, now I understand the key concept that your are missing. :)

    1. "Do the property settings in TppReport persist in the end-user
    environment?"

    No. Each time you load a report, the property settings that existed at the
    time the report was saved are restored. Therefore the TppReport properties
    are constantly being updated to reflect the report template that is loaded.

    2. Note the following from my first response to you on this thread:

    ...when you load a report from .rtm or database, the NoDataBehaviors that
    were saved with the report will be used. You can use the
    Report.Template.OnLoadEnd event to initialize the NoDataBehaviors after a
    report is loaded. Perhaps that is what you need
    to do here.

    3. ReportBuilder uses standard Delphi component streaming. When Delphi
    components save/load their state, they save/load the values of all published
    properties.



    --


    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.