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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Print

Thread ID:

Created:

Updated:

Platform:

Replies:

31951 Jul 19,2005 06:44 AM UTC Jul 19,2005 10:35 AM UTC WinForms 5
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On July 19, 2005 06:44 AM UTC

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 08:01 AM UTC

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 08:30 AM UTC

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 08:48 AM UTC

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)
{
	base.OnPrintPage(ev);

	if(pageNo == 1)
	{
		//.....
	}
	pageNo++;
}
This will be the simplest thing to do if it will serve your needs.

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

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 10:35 AM UTC

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;
}

CONFIRMATION

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.

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

;