$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
Windows Forms PivotGrid Control
Create interactive user interface of Pivot table, build summarizations and highlight specific data
Home > WinForms UI Controls > User Manual > Customize PivotGrid Printing in C#

Printing Events and Customization of PivotGrid in C#.NET

KetticPivotGrid control provides two different C# events for the users to customize the appearance and build custom painting to the cells of Pivot reports that will be printed. KetticPivotGrid .NET component is capable of native printing and the end users of your application can directly pass the content of Pivot reports to the default printer. With friendly user interface of dialogs of KetticPivotGrid WinForms control, the users can easily change the print settings to the Pivot reports.

Customize Appearance of Cells in Pivot reports in C#

To customize the appearance of cells in Pivot reports that will be printed, we are able to use the C# events included in the KetticPivotGrid .NET component, FormatPrintElement and PrintElementPaint. The FormatPrintElement event allows the users to format the printed cells both in colors and values and the PaintPrintElement event allows the users to add custom painting to printed cells in Pivot reports. The following is a C# code sample that demonstrates the customization of Pivot report cells.

private void ketticPivotGrid1_FormatPrintElement(object sender, Kettic.WinForms.UI.PrintElementEventArgs e)
{
PivotCellPrintElement cell = e.PrintElement as PivotCellPrintElement;
if (cell != null && cell.Value != null && (Convert.ToDouble(cell.Value)) < 80)
{
cell.BackColor = Color.Red;
}

if (cell != null && cell.Value != null && (Convert.ToDouble(cell.Value)) > 200)
{
cell.BackColor = Color.Green;
}
}


private void ketticPivotGrid1_PaintPrintElement(object sender, PrintElementPaintEventArgs e)
{
PivotCellPrintElement cell = e.PrintElement as PivotCellPrintElement;
if (cell != null && cell.Value == null)
{
Brush b = new HatchBrush(HatchStyle.BackwardDiagonal, Color.LightGray, Color.Transparent);
e.Graphics.FillRectangle(b, e.Bounds);
}
}
UI Controlsfor Windows Forms
.NET WinForms UI Overview.NET WinForms UI Features.NET WinForms UI GuideC# WinForms UI DesignVB.NET WinForms UI Design
WinForms UI Controls