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


Thread ID:





31951 Jul 19,2005 02:44 AM Jul 19,2005 06:35 AM Windows Forms 5
Tags: GridControl
Administrator [Syncfusion]
Asked On July 19, 2005 02:44 AM

I need to print some text information to be printed on the first page before the grid is printed. I want this information to be printed only on the first page. Kindly let me know the possible solution for this

Administrator [Syncfusion]
Replied On July 19, 2005 04:01 AM

Here is a KB explaining how to print footers and headers. http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=62

Administrator [Syncfusion]
Replied On July 19, 2005 04:30 AM

Clay, I need to print some test information before the grid. ITs not a header or a footer. I want it to be printed only on the first page. Suppose if the grid is printed in three or four pages, I want this test information to be printed in the first page. Thanks

Administrator [Syncfusion]
Replied On July 19, 2005 04:48 AM

In that sample, you can choose to print or not print stuff in OnPrint based on the page number. So, you can print stuff on page one, but not print it on page 2,3,....
protected override void OnPrintPage(System.Drawing.Printing.PrintPageEventArgs ev)

	if(pageNo == 1)
This will be the simplest thing to do if it will serve your needs.

Administrator [Syncfusion]
Replied On July 19, 2005 06:15 AM

I am adding this line to print some text before grid..but it overlaps with the gridcontrol if(pageNo == 1) ev.Graphics.DrawString(text, font, Brushes.Black, new RectangleF(x+25, y+25, w, h), format);

Administrator [Syncfusion]
Replied On July 19, 2005 06:35 AM

Did you adjust the margines as in the sample?
public GridPrintAtLocDocument(GridControlBase grid, bool printPreview)
	: base(grid, printPreview)
	_grid = grid;

	headerHeight = 50;
	footerHeight = 20;

	int left = this.DefaultPageSettings.Margins.Left;
	int top = this.DefaultPageSettings.Margins.Top + headerHeight;  //50 lower
	int right = this.DefaultPageSettings.Margins.Right;
	int bottom = this.DefaultPageSettings.Margins.Bottom;
	this.DefaultPageSettings.Margins =  new Margins(left, right, top, bottom);

	pageNo = 1;


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.

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.