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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Margin problems printing header/footer using GridPrintDocument

Thread ID:





1954 Dec 5,2002 06:20 PM UTC Dec 7,2002 10:43 AM UTC WinForms 1
Tags: GridControl
Administrator [Syncfusion]
Asked On December 5, 2002 06:20 PM UTC

Hi, I want to print custom header and footer for my printouts. So, I derived ReportPrintDocument from the GridPrintDocument base class. I am having trouble controlling margins. It looks like the GridPrintDocument is calculating the number of rows that be fit into a page in the OnBeginPrint() method. In OnBeginPrint(), I am shrinking the margins, so that my header+footer can be printed. In OnPrintPage(), I am painting my header/footer and letting the grid paint in the middle. Here is where I am having a problem. I want to print the header only on first page. My first page is coming ok. But from page #2, for some reason the grid is not going till the bottom. Reproduction steps: 1. Please run the attached sample. 2. Click set data button. 3. Click printpreview. Goto page #2. Notice that another 5 to 10 rows can be added at the bottom. Am I doing something wrong? Is there an easier way to print my custom header/footer? thanks, - Reddy

Administrator [Syncfusion]
Replied On December 7, 2002 10:43 AM UTC

Reddy, I don't think there is a simple way around this problem currently. The actual grid rows/columns that will appear on any given printed page is currently being set in the baseclass OnBeginPrint method, and there is no public or protected access to the internal members that hold this information. We do intend to enhance printing support in our 2.0 release, but I will discuss this with Stefan to see if we can expose either an event or something that will give you the access you need before that release. I'll post here after we have discussed it. Clay


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon