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

Error in RAP code

edited July 2004 in RAP
HI!

I have a file RTM with a template creates and modifies runtime by the user
by a ppDesigner.

When I decide to print this template from another point of my project I
create all the needed component runtime and I load my template.
All works fine if I don't access the table from RAP.
I compile correctly in the designer.

The error is: "impossibile compilare il programma: DetailBeforePrint." in
italian language :D

// *********
a portion of code is:

dsEmissioniT := TDataSource.Create(nil);
dsEmissioniT.Name := 'dsEmissioniT';
dsEmissioniT.DataSet := tblEmissT;

ppEmissioniTestate := TppDBPipeline.Create(nil);
ppEmissioniTestate.Name := 'ppEmissioniTestate';
ppEmissioniTestate.DataSource := dsEmissioniT;
ppEmissioniTestate.RangeBegin := rbCurrentRecord;
ppEmissioniTestate.RangeEnd := reCurrentRecord;
ppEmissioniTestate.UserName := 'EmissioniTestate';

ppReport1 := TppReport.Create(nil);
ppReport1.CreateDefaultBands;

ppReport1.DataPipeline := ppEmissioniTestate;

ppReport1.DeviceType := dtPrinter;
ppReport1.Template.FileName := sPathReport + sNomeFile;
ppReport1.Template.LoadFromFile;

ppReport1.Print;

ppReport1.Free;
ppEmissioniTestate.Free;
dsEmissioniT.Free;

// *********

the code in the RAP section is:

beginif EmissioniTestate['CLASSE'] = 2 then

label7.caption := 'classe 2';

end;

Comments

  • edited July 2004
    Sorry I have sent early :)

    I use RB 7.04 with DBISAM 4.05.
    I have kept the same name of the component (in particular datapipe)..

    Can you help me please!?!

    Thanks

    Barbi


    "Barbi" ha scritto nel messaggio
  • edited July 2004


    The report, datapipeline, etc. all need to have the same Owner. The Owner is
    typically a Form/DataModule. This enables the all of the object references
    to be resolved when the .rtm is loaded. (RB is using standard Delphi
    streaming and that is how object references are resolved).


    --


    Best regards,

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