WPCubed Product Support

AppendAsSection and headers/footers issue

I am using the following to start new sections:

WPRichText_Rpt.HeaderFooter.AppendAsSection(WPRichText1.HeaderFooter);

If the origninal WPRichText1 is a single page with headers/footers, the next AppendAsSection's WPRichText1 that does NOT have headers/footers correctly does not have headers/footers when appended.

However, if the original WPRichText1 flows into a second page, then the next AppendAsSection's WPRichText1 that has no headers/footers incorrectly carries over the current headers/footers to the new appended section that is not suppose to have a header/footer. If that 2nd WPRichtText1 had a header/footer, then it is fine. It seems to be an issue only if the 2nd one has no headers/footers of its own and the previous section was at least two pages.

This worked with WPT5, but not in WPT8. Am I missing some new setting?

Thanks,

Eric

#1 ♥ 0
5.9k Views 2 users read 2 min
wpsupport

AppendAsSection copies all headers and footers to belong to a section which is created new.

But those headers and footers replace the previous - it is normal and expected that if you have global headers and footers they will also be displayed for sections.

Do you anything with the result TWPRTFSectionProps of this function?

#2 ♥ 0

No, I do not do anything with the result. I don't even assign the AppendAsSection's result. It is just very odd that it works if the first section is a single page with headers/footers and the 2nd section does not have headers/footers of its own, but fails if the first section is more than one page.

I may have to put together a simple example for you. At least to prove to myself that it is not something else in my code that is breaking it even though I am just adding additional lines to section one until it moves to two pages.

#3 ♥ 0

I just sent you a sample program illustrating the issue. Hopefully it is something simple.

Thanks!

Eric

#4 ♥ 0
wpsupport

Thank You - I will refine the behavior. Since 2012 there is code which looks for inherited header and footer.

#5 ♥ 0
This category is archived. No new posts are possible.