Home RAP

TppNoDataDialog in RAP

edited April 2012 in RAP
Hi,

Using Delphi 6, RB Server 11.08.

I am trying to customise the text of the message dialog that appears when
there is no data, and the report's NoDataBehaviours is set to [ndBlankPage,
ndMessageDialog], in the RAP.

I have this code in the Report.OnNoData event, as suggested by the help file
(TppCustomReport.OnNoData):

procedure ReportOnNoData(aDialog: TObject; var aShowDialog: Boolean;
aDrawCommand: TObject; var aAddDrawCommand: Boolean);
var
lDialog: TppNoDataDialog;
begin
aShowDialog := True;
aAddDrawCommand := False;

lDialog := TppNoDataDialog(aDialog);
lDialog.memMessage.Text := 'Nothing to see here.';
end;

However, it appears that the memMessage property is not published in RAP
because I get this compile error within the report:

Error: ReportOnNoData, Line 9: Expected '(' or '[', but found 'memMessage'
instead.

Am I doing something wrong or missing something?

Thank you,
Jason.

Comments

  • edited April 2012
    Open ppNoDataDlg.pas and modify TppNoDataDialog so that it has a published
    property for the memo.

    You can either do something like this...

    published
    property memoMessage: TMemo read memMessage;

    Or you can rename memMessage to FmemMessage and then make the property
    memMessage. I will make this latter enhancement for the next RB 14
    maintenance release.

    published
    property memMessage: TMemo read FmemMessage;

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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited April 2012
    Great, thank you Nard.

    Jason.

This discussion has been closed.