hello,
it seems that composite doesn't work with preparedreport.
to combine your 3 prepared reports you can try this :
1 - create a new procedure AddPreparedReport in the tfrReport class ( file LR_Class.pas) of lazreport package :
procedure AddPreparedReport(const FName: String);
.....
procedure TfrReport.AddPreparedReport(const FName: String);
var
Stream: TFileStream;
begin
Stream := TFileStream.Create(UTF8ToSys(FName), fmOpenRead);
EMFPages.AddPagesFromStream(Stream);
Stream.Free;
CanRebuild := False;
end;
and now to use this new procedure :
procedure TForm1.Button2Click(Sender: TObject);
var
r,rx: TfrReport;
report1:string;
report2:string;
report3:string;
PathApp: String;
begin
PathApp := ExtractFilePath(ParamStrUTF8(0));
if PathApp[Length(PathApp)]<>PathDelim then PathApp := PathApp+PathDelim;
report1 := 'report1.nkm';
report2 := 'report2.nkm';
report3 := 'report3.nkm';
r:=TfrReport.create(self);
r.LoadPreparedReport(PathApp+report1);
r.AddPreparedReport(PathApp+report2);
r.AddPreparedReport(PathApp+report3);
r.ShowPreparedReport;
r.Free;
end;
if you don't want modify LR_Class file, you can try this :
procedure TForm1.Button2Click(Sender: TObject);
var
r,rx: TfrReport;
report1:string;
report2:string;
report3:string;
PathApp: String;
Stream: TFileStream;
begin
PathApp := ExtractFilePath(ParamStrUTF8(0));
if PathApp[Length(PathApp)]<>PathDelim then PathApp := PathApp+PathDelim;
report1 := 'report1.nkm';
report2 := 'report2.nkm';
report3 := 'report3.nkm';
r:=TfrReport.create(self);
r.LoadPreparedReport(PathApp+report1);
Stream := TFileStream.Create(UTF8ToSys(PathApp+report2), fmOpenRead);
r.EMFPages.AddPagesFromStream(Stream);
Stream := TFileStream.Create(UTF8ToSys(PathApp+report3), fmOpenRead);
r.EMFPages.AddPagesFromStream(Stream);
r.ShowPreparedReport;
Stream.Free;
r.Free;
end;
friendly, J.P