Working with Anchors
hello,
I need to build a complex Report out of several small reportfiles. These files I append with "frxReport1.PrepareReport(false)" to the report engine. I need to build a Contents-Chapter (TOC), so in some of the files an Anchor will be created with "Engine.AddAnchor( );".
All the reportfiles inherites from a base report file in which I set the option "two-pass".
First Problem: the Engine.GetAnchorPage always returns 1
second Problem: after export to PDF the Anchors don't work anymore.
Is there any solution?
Thanks
Lemmy
I need to build a complex Report out of several small reportfiles. These files I append with "frxReport1.PrepareReport(false)" to the report engine. I need to build a Contents-Chapter (TOC), so in some of the files an Anchor will be created with "Engine.AddAnchor( );".
All the reportfiles inherites from a base report file in which I set the option "two-pass".
First Problem: the Engine.GetAnchorPage always returns 1
second Problem: after export to PDF the Anchors don't work anymore.
Is there any solution?
Thanks
Lemmy
Comments
I have a huge report made of several chapters, with the TOC, and it works beautifully.
I cant give you much details, but the basic idea is this:
Create MainRpt:TfrxReport ;
Create SubRpt:TfrxReport ;
repeat the block below for every subreport:
SubRpt.Loadfromfile(filename);
for each page in SubRpt (disconsider the Data page) begin
SubRpt.page.savetostream(AnyStream);
subPage := MainRpt.CreateNewPage;
subPage.LoadFromStream(AnyStream);
end;
MainRpt.Show(true);
In this case, you consolidated all report objects into only 1, much easier to mantain, I doubt your Anchors won't work if they were already working inside each individual subreport.
Plus, you will be able to save the final report into one file (fr3) too.
Oh, by the way, that's not about the export to PDF problem, I don't know anything about that one, sorry.
Good luck