Shared Bands
hello.
I have to enter shared band, that is jeneral to all my reports (like REPORT TITLE, with logo, name og company and more..).
This band must be able to have those qualities:
1. It must be exported from jeneral report, and imported at RUN TIME to all of the reports, so change that will be put in it, will influence all the reports automaticaly.
2. it must enter as a band, not as entire page (Like shared logo). that is, it will take only the rows that it has to, and will be be preview and printed as an integral band of the report.
I think the composite reports can not do that things, and it is very important to have in Report generator system.
thanks
yaron.
I have to enter shared band, that is jeneral to all my reports (like REPORT TITLE, with logo, name og company and more..).
This band must be able to have those qualities:
1. It must be exported from jeneral report, and imported at RUN TIME to all of the reports, so change that will be put in it, will influence all the reports automaticaly.
2. it must enter as a band, not as entire page (Like shared logo). that is, it will take only the rows that it has to, and will be be preview and printed as an integral band of the report.
I think the composite reports can not do that things, and it is very important to have in Report generator system.
thanks
yaron.
Comments
I havent tried this, it's just an idea!
Suppose you create a general report with the band you want to use in it and test it with all the objects you want.
Procedure Somefunction;
Var
StdBand , TargetBand : TfrxReportTitle; // or TfrxDataBand etc....??
S : TmemoryStream;
begin
S := TMemoryStream.Create;
StdBand := MyStandardfrxReport.FindObject(StdBandName);
StdBand.SaveToStream(S, True,False?? );
//SaveToStream(Stream: TStream;SaveChildren ,SaveDefaultValues:Boolean);
TargetBand:= MyReportToUse.FindObject(TargetBandName);
//Or create one?
TargetBand.LoadFromStream(S);
S.free;
......
Hope this gives you some ideas!
Bruce
Thanks for the response.
I did what you have suggested, but the generator had the exception: 'Invalid File Format'.
What can I do to solve the problem ?
And more : Do you have the intention to upgrade the generator to do the Shared Band ?
Thanks.
Yaron.
Is this when you try to compile your project in Delphi or when you run it?
I have only seen this once before when installing a component, something to do with packages not being compiled in the correct order.
>And more : Do you have the intention to upgrade the generator to do the Shared Band ?
Sorry Yaron, I'm just a FastReports user like you!
Bruce
This huppens when the report is executed.
Thanks.
Yaron.
Correction to my last response:
The exception show on executing the line: 'TargetBand.LoadFromStream(S);'
That is, before even executing the report.
Thanks.
Yaron.
You will need to
memStream.Postition := 0;
before you LoadFromStream.
The approach with Object.Save/LoadFromStream seems handy enough. I Load a complete page (it is a optional title page with data selection information) and that seems to work good as long as there are no duplicate names.
BUT HOW DO I move the created page before all existing ones by code????
Regards,
/Dany