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

Issue with printing PerformanceGrid.

I''m using PerformanceGrid. Showing Print Preview and Printing this print reveales this problem shown in the attached picture. Basically a smaller grid draws in the left top corner and grid''s empty table draws on the entire page. Is there any remedy to this? Thanks

PerformanceGridPrintOreviewProblem.zip

8 Replies

AD Administrator Syncfusion Team October 27, 2005 04:28 PM UTC

Do you have the UseGDI set true? If so, turn it off to see if that takes care of this problem. If so, then in the derived grid you can conditionally ignore the UseGDI in OnDrawCellDisplayText. This way GDI would be used when the display is the screen and GDI+ would be used for printing.
protected override void OnDrawCellDisplayText(GridDrawCellDisplayTextEventArgs e)
{
	base.OnDrawCellDisplayText (e);
		if (!UseGDI || e.Cancel || PrintingMode)
		return;

	e.Cancel = GridGdiPaint.Instance.DrawText(e.Graphics, e.DisplayText, e.TextRectangle, e.Style);
}


MI Mike October 27, 2005 04:56 PM UTC

Definitely fixes the main problem. Thanks! The minor problem is some cells get clipped with ... On the screen the cell contents don''t get clipped. Any suggestions? Thanks

MinorPrintingIssue.zip


AD Administrator Syncfusion Team October 27, 2005 05:42 PM UTC

You can probably turn off the .... through a style setting. grid.TableStyle.Trimming = StringTrimming.None; But this may clip some of the text (or it may not). If it does, you could try making the column 1 or 2 pixels wider. Or, you could turn off UseGDI and then call grid.ColWidths.ResizeToFit, and then turn UseGDI back on to see if this would avoid the problem.


AD Administrator Syncfusion Team October 27, 2005 07:45 PM UTC

I do not think I can use FitToSize on my virtual grid. I think I need to build my own print document. It''ll allow me to take a snapshot of the grid data and control the sizes of the columns & print font. Do you guys have any sample that would implement these requirements; creates a print document for the grid but uses custom painting of the data? Thanks


AD Administrator Syncfusion Team October 27, 2005 09:06 PM UTC

In the grid KB there is a category name Quick Start-Printing. It has several samples on doing some customized printing. Here is one link, some of the others may also be helpful. http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=63


AD Administrator Syncfusion Team April 14, 2006 05:39 AM UTC

hi, can someone please post sample code for printing the performance grid using GDI. thanks in advance


AD Administrator Syncfusion Team April 18, 2006 04:47 AM UTC

using the same Performance grid sample, Im having a strange problem where the values on the grid disappear when the Print dialog box shows up. Not all the values but only the ones overlapping the print dialog. Print dialog works like an eraser :) Any clues on fixing this problem ? Thanks in advance, Sunny


AD Administrator Syncfusion Team April 18, 2006 06:34 AM UTC

Hi Sunny, Here is the sample which, prints the performance grid sample fine here. Please try it and let us know if this helps. Sample : PerformanceGrid Best regards, Madhan

Loader.
Live Chat Icon For mobile
Up arrow icon