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

Margin problems printing header/footer using GridPrintDocument

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

1 Reply

AD Administrator Syncfusion Team 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

Live Chat Icon For mobile
Up arrow icon