Back to Devexpress

PivotGridControl.IsPrintingAvailable Property

windowsforms-devexpress-dot-xtrapivotgrid-dot-pivotgridcontrol-a50459b6.md

latest3.6 KB
Original Source

PivotGridControl.IsPrintingAvailable Property

Indicates whether the Pivot Grid Control can be printed.

Namespace : DevExpress.XtraPivotGrid

Assembly : DevExpress.XtraPivotGrid.v25.2.dll

NuGet Package : DevExpress.Win.PivotGrid

Declaration

csharp
[Browsable(false)]
public bool IsPrintingAvailable { get; }
vb
<Browsable(False)>
Public ReadOnly Property IsPrintingAvailable As Boolean

Property Value

TypeDescription
Boolean

true if the Pivot Grid Control can be printed; otherwise, false.

|

Remarks

The Pivot Grid Control can be printed if the XtraPrinting Library is available. To print the control, call the PivotGridControl.Print method.

Example

The following example demonstrates how to print the Pivot Grid control using the PivotGridControl.Print method and show its Print Preview window using the PivotGridControl.ShowPrintPreview method.

Note

Printing functionality depends on the DevExpress.XtraPrinting library. To verify that the library is available, use the PivotGridControl.IsPrintingAvailable property.

You can access print settings and modify them using the PivotGridControl.OptionsPrint property.

csharp
using DevExpress.XtraPivotGrid;
// ...

private void ShowPivotGridPreview(PivotGridControl pivotGrid) {
    // Verify that the Pivot Grid Control can be printed.
    if (!pivotGrid.IsPrintingAvailable) {
        MessageBox.Show("Missing DevExpress.XtraPrinting library", "Error");
        return;
    }
    pivotGrid.ShowPrintPreview();
}

private void PrintPivotGrid(PivotGridControl pivotGrid) {
    // Verify that the Pivot Grid Control can be printed.
    if (!pivotGrid.IsPrintingAvailable) {
        MessageBox.Show("Missing DevExpress.XtraPrinting library", "Error");
        return;
    }
    pivotGrid.Print();
});
}
vb
Imports DevExpress.XtraPivotGrid
' ...

Sub ShowPivotGridPreview(ByVal pivotGrid As PivotGridControl)
   ' Verify that the Pivot Grid Control can be printed.
   If Not pivotGrid.IsPrintingAvailable Then
        MessageBox.Show("Missing DevExpress.XtraPrinting library", "Error");
      Return
   End If
   pivotGrid.ShowPrintPreview()
End Sub

Sub PrintPivotGrid(ByVal pivotGrid As PivotGridControl)
   ' Verify that the Pivot Grid Control can be printed.
   If Not pivotGrid.IsPrintingAvailable Then
        MessageBox.Show("Missing DevExpress.XtraPrinting library", "Error");
      Return
   End If
   pivotGrid.Print()
End Sub

See Also

Print()

ShowPrintPreview()

PivotGridControl Class

PivotGridControl Members

DevExpress.XtraPivotGrid Namespace