We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Header and footer

Hi,
I am trying to generate a forward only tables ( multiple tables ) and have a header and footer different for each page. There are a number of examples that shows how to change the header. But in this case if the table spans more than a page, the header is not drawn. If I attach the header to the .LastPage property, it gets over-written and if I attach it to the template it does not get drawn except in the first page of the starting of new table.

I have attached an example. How do I keep drawing the same header for the span of a table and then change it with a new table.

Thanks.

CS38.zip

3 Replies

DK Dhivya K Syncfusion Team October 27, 2006 05:32 PM UTC

Hi Yusuf,

Thank you for your interest in Essential PDF.
Thanks for sending the sample. I was able to see the problem in your code. You have used Table publishing events in generating table which publishes the table well before the headers. If you want to display the template in all the pages,you have to add the header template in PageCreated event which will be called every time when the page is created.
I have modified and simplified your sample in order to display the header in all the pages and different header text for different tables.

Here is a code snippet for your reference:

//Add the header in PageCreatedEvent
void pdfDoc_PageCreated ( object sender, PageCreatedEventArgs args )
{

AddHeader(pdfDoc, headerText, "HeaderAndFooter Demo Sample");

}

I have attached the modified sample for your reference

Please take a look into it and let me know if you have any other queries.

Regards,
Dhivya.

CS380.zip


AD Administrator Syncfusion Team October 27, 2006 09:40 PM UTC

that work
Thanks


DK Dhivya K Syncfusion Team October 28, 2006 04:49 AM UTC

Hi Yusuf,

Glad to know that it works fine.Thanks for the update!

Regards,
Dhivya.

Loader.
Live Chat Icon For mobile
Up arrow icon