GridViewExtension.CreatePrintableObject(GridViewSettings, Object) Method

Enables a GridView to be printed using the XtraPrinting Library.

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v20.2.dll


public static IBasePrintable CreatePrintableObject(
    GridViewSettings settings,
    object dataObject
Public Shared Function CreatePrintableObject(
    settings As GridViewSettings,
    dataObject As Object
) As IBasePrintable


Name Type Description
settings GridViewSettings

A GridViewSettings object that contains GridView settings.

dataObject Object

An object representing the GridView's data source (typically, it is passed to the grid's GridViewExtension.Bind method).


Type Description

An interface that allows you to print GridView data.


public ActionResult Export()  
    var ps = new PrintingSystem();  
    var link = new PrintableComponentLink(ps);  
    link.Component = GridViewExtension.CreatePrintableObject(GetSettings(), DataProvider.GetData().ToList());  
    // ...
    return result;  

Note that the BeforeExport property is not in effect if you use the CreatePrintableObject method. Instead, use the GridViewExtension.ExportTo[FormatName] methods to export data.

See Also