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

Decendent of TppReport (new propertie doesn't seem te load. How does it work?)

edited February 2004 in End User
Hi,

I created a descendent of tppReport

TppQBReport = class(TppReport)
private
FOrderBy: String;
protected
procedure Transfer(aSource: TppCommunicator); override;
public
....
published
property OrderBy: String read FOrderBy write FOrderBy;
end;

When i set this property (by modifing the ascii code of the report)
and then opening the report (i'm using the enduser app so the
reportcomponent
of the datamodule is used. But I changed this to the same type!

Anyway the propertie stays empty. I tried Transfer function.

procedure TppQBReport.Transfer(aSource: TppCommunicator);
begin
inherited;
if aSource is TppQBReport
then OrderBy := TppQBReport(aSource).OrderBy;
end;

But it stays empty.

Any Ideas?

Thanks
Ebo Dieben

Comments

  • edited March 2004

    The code looks ok. The classtype of the saved report and the classtype of
    the Report component that you are using to load the template would need to
    be TmyQBReport. (BTW, you should really choose unique prefix that does not
    conflict with Tpp.)

    ReportBuilder uses standard Delphi component streaming. There is the
    additional transfer step when loading a template. You can trace the source
    code in RBuilder\Source\ppTemplat.pas.

    All classes that are streamed in Delphi, must be registered with a call to
    RegisterClasses().

    Unless you register the custom component with the Delphi IDE, you will need
    to create it programmatically in code. If you want to register the component
    with the Delphi IDE, you need to create one or more packages. And you need
    to register the component - see ppRegPro.pas for an example.




    --
    Nard Moseley
    Digital Metaphors
    http://www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited March 2004
    It works
    I am not sure why it didn't a first because i didn't change anything.
    It is a mistery :)

    Thanks anyway
    Ebo Dieben

This discussion has been closed.