'Declaration Public Property ClippingOverride As ClippingOverride
public ClippingOverride ClippingOverride {get; set;}
There are inconsistencies in the way certain printer drivers implement the printing APIs that UltraWinGrid uses to create its reports. In most instances, the control can detect the presence of these drivers and compensate automatically.
Some printer drivers handle the clipping of text regions inconsistently. Without compensation, reports printed using these drivers may have text that overlaps multiple cells, or letters may extend below the grid lines dividing headers from rows, or rows from rows. Text wrapping may also be affected.
Note that, while rows can automatically resize themselves vertically to accommodate larger font sizes, column and group headers cannot. If the text in a column or group header is being clipped, you may simply need to resize the header so that all the text is showing. However, under normal circumstances the header text should never extend past the borders of the header, either vertically or horizontally.
The ClippingOverride property gives you the ability to determine how UltraWinGrid will handle the detection and correction of printer driver clipping inconsistencies. The default setting, ClippingOverrideAuto, causes the control to automatically detect whether the current driver requires compensation, and apply it if it does. This setting should work in most cases, and should not be changed unless you absolutely have to.
The other settings of ClippingOverride give you manual control over whether clipping compensation is applied. Setting the property to ClippingOverrideYes will apply text clipping compensation even if the control determines the driver does not require it. A setting of ClippingOverrideNo will turn off compensation, even if the control determines that it is necessary.
You may find that you only need to apply correction to certain versions of a particular printer driver. You can use the properties of the PrintDocument object to determine which printer dirver is being used to print the report and what the version of that driver is.
Note An incorrect setting for the ClippingOverride property may produce unpredictable results when printing reports. You may see text overlapping the lines in the grid, text extending outside the cell that contains it, or you may see a gap between the edge of the printed text and the edge of the cell. If you experience problems such as these, first try setting ClippingOverride to its default setting. If you find these types of problems occurring when using the default value, try setting the property to one of the other values.
You should also note that problems of this nature may stem from problems completely external to UltraWinGrid and your application, such as insufficient printer memory. When attempting to troubleshoot printing problems, make sure your printer settings are correct and try using different driver settings (such as printing TrueType fonts as graphics or printing at a lower resolution) before changing the value of this property.
Imports Infragistics.Shared Imports Infragistics.Win Imports Infragistics.Win.UltraWinGrid Private Sub UltraGrid1_InitializePrintPreview(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.CancelablePrintPreviewEventArgs) Handles ultraGrid1.InitializePrintPreview ' Set the zomm level to 100 % in the print preview. e.PrintPreviewSettings.Zoom = 1.0 ' Set the location and size of the print preview dialog. e.PrintPreviewSettings.DialogLeft = SystemInformation.WorkingArea.X e.PrintPreviewSettings.DialogTop = SystemInformation.WorkingArea.Y e.PrintPreviewSettings.DialogWidth = SystemInformation.WorkingArea.Width e.PrintPreviewSettings.DialogHeight = SystemInformation.WorkingArea.Height ' Horizontally fit everything in a signle page. e.DefaultLogicalPageLayoutInfo.FitWidthToPages = 1 ' Set up the header and the footer. e.DefaultLogicalPageLayoutInfo.PageHeader = "Title" e.DefaultLogicalPageLayoutInfo.PageHeaderHeight = 40 e.DefaultLogicalPageLayoutInfo.PageHeaderAppearance.FontData.SizeInPoints = 14 e.DefaultLogicalPageLayoutInfo.PageHeaderAppearance.TextHAlign = HAlign.Center e.DefaultLogicalPageLayoutInfo.PageHeaderBorderStyle = UIElementBorderStyle.Solid ' Use <#> token in the string to designate page numbers. e.DefaultLogicalPageLayoutInfo.PageFooter = "Page <#>." e.DefaultLogicalPageLayoutInfo.PageFooterHeight = 40 e.DefaultLogicalPageLayoutInfo.PageFooterAppearance.TextHAlign = HAlign.Right e.DefaultLogicalPageLayoutInfo.PageFooterAppearance.FontData.Italic = DefaultableBoolean.True e.DefaultLogicalPageLayoutInfo.PageFooterBorderStyle = UIElementBorderStyle.Solid ' Set the ClippingOverride to Yes. e.DefaultLogicalPageLayoutInfo.ClippingOverride = ClippingOverride.Yes ' Set the document name through the PrintDocument which returns a PrintDocument object. e.PrintDocument.DocumentName = "Document Name" End Sub
using Infragistics.Shared; using Infragistics.Win; using Infragistics.Win.UltraWinGrid; using System.Diagnostics; private void ultraGrid1_InitializePrintPreview(object sender, Infragistics.Win.UltraWinGrid.CancelablePrintPreviewEventArgs e) { // Set the zomm level to 100 % in the print preview. e.PrintPreviewSettings.Zoom = 1.0; // Set the location and size of the print preview dialog. e.PrintPreviewSettings.DialogLeft = SystemInformation.WorkingArea.X; e.PrintPreviewSettings.DialogTop = SystemInformation.WorkingArea.Y; e.PrintPreviewSettings.DialogWidth = SystemInformation.WorkingArea.Width; e.PrintPreviewSettings.DialogHeight = SystemInformation.WorkingArea.Height; // Horizontally fit everything in a signle page. e.DefaultLogicalPageLayoutInfo.FitWidthToPages = 1; // Set up the header and the footer. e.DefaultLogicalPageLayoutInfo.PageHeader = "Title"; e.DefaultLogicalPageLayoutInfo.PageHeaderHeight = 40; e.DefaultLogicalPageLayoutInfo.PageHeaderAppearance.FontData.SizeInPoints = 14; e.DefaultLogicalPageLayoutInfo.PageHeaderAppearance.TextHAlign = HAlign.Center; e.DefaultLogicalPageLayoutInfo.PageHeaderBorderStyle = UIElementBorderStyle.Solid; // Use <#> token in the string to designate page numbers. e.DefaultLogicalPageLayoutInfo.PageFooter = "Page <#>."; e.DefaultLogicalPageLayoutInfo.PageFooterHeight= 40; e.DefaultLogicalPageLayoutInfo.PageFooterAppearance.TextHAlign = HAlign.Right; e.DefaultLogicalPageLayoutInfo.PageFooterAppearance.FontData.Italic = DefaultableBoolean.True; e.DefaultLogicalPageLayoutInfo.PageFooterBorderStyle = UIElementBorderStyle.Solid; // Set the ClippingOverride to Yes. e.DefaultLogicalPageLayoutInfo.ClippingOverride = ClippingOverride.Yes; // Set the document name through the PrintDocument which returns a PrintDocument object. e.PrintDocument.DocumentName = "Document Name"; }
Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2