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

Print and Preview of a Grid little in top left corner

Thread ID:

Created:

Updated:

Platform:

Replies:

46478 Jul 13,2006 11:36 AM UTC Jul 21,2006 08:39 AM UTC WinForms 7
loading
Tags: GridControl
Francesco Donati
Asked On July 13, 2006 11:36 AM UTC

When I do a print or a printpreview of the grid I see a little grid with data in the top left corner and the an empty grid (with normal size) in the center. Here the code I use for the PrintPreview: GridPrintDocument pd = new GridPrintDocument(grid, true); PrintPreviewDialog dlg = new PrintPreviewDialog() ; dlg.Document = pd; dlg.ShowDialog();

Administrator [Syncfusion]
Replied On July 13, 2006 12:51 PM UTC

Hi Francesco, Can you please send some screenshots showing this behavior, we are not able to see this happening here with the code that you are using. Please refer to the following KnowledgeBase(KB) articles, How do I Print Preview my grid? How do I print my grid? How to print two or more grids in a same page? Thanks, Rajagopal

Francesco Donati
Replied On July 13, 2006 01:51 PM UTC

In attach the screenshot. Thanks in advance. Francesco

screenshot19.zip

Administrator [Syncfusion]
Replied On July 14, 2006 07:35 AM UTC

Hi Francesco, I am not able to reproduce this problem here. If you can post a sample reproduing the problem in any of the Syncfusion browser samples, the we can try to spot something here. Actually when you try to PrintPreview from the PrintPreviewDialog, it is not Essential Grid code setting up the preview. The PrintPreview support is part of the standard .NET Framework class so we are not sure what grid events would effect this. Try this sample. It just draws a rectangle on the page and has no Syncfusion code in it. Do you see the same problem with it? Here is sample http://www.syncfusion.com/Support/user/uploads/GenericPrinting_a66a877f.zip Regards, Rajagopal

Francesco Donati
Replied On July 17, 2006 12:57 PM UTC

Hi Rajagopal, Your test does not show the problem. I have modified it inserting the grid control in the way we use it. In this case the problem appears. The problem disappears if I comment the lines in "OnDrawCellDisplayText" and "OnFillRectangleHook" that set the e.cancel. This way of use the grid was suggested by you as answer to the defect "42320: real time updates". Do you have any suggestion? Thanks Francesco Thanks Francesco

GenericPrinting.zip

Administrator [Syncfusion]
Replied On July 19, 2006 12:56 PM UTC

Hi Francesco,

We are looking into this issue and will update you the details soon.
Thanks for your patience.
Regards,
Rajagopal

Administrator [Syncfusion]
Replied On July 19, 2006 03:20 PM UTC

Hi Francesco,

In the OnDrawCellDisplayText and OnFillRectangleHook overrides, please check for the PrintingMode property and return. This will resolve the problem.

protected override void OnDrawCellDisplayText(GridDrawCellDisplayTextEventArgs e)
{
if(PrintingMode)
return;

if (!UseGDI)
base.OnDrawCellDisplayText (e);

if (!UseGDI || e.Cancel)
return;

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

protected override void OnFillRectangleHook(GridFillRectangleHookEventArgs e)
{
if(PrintingMode)
return;

if (!UseGDI)
base.OnFillRectangleHook (e);

if (!UseGDI || e.Cancel)
return;

e.Cancel = GridGdiPaint.Instance.FillRectangle(e.Graphics, e.Bounds, e.Brush);
}

Regards,
Rajagopal

Francesco Donati
Replied On July 21, 2006 08:39 AM UTC

It works fine.

Many thanks
Francesco


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

;