@model IEnumerable<FlexGridData.Sale>

<h1>
    Export to PDF
</h1>

<p>
    To export FlexGrid to PDF, call the
    <b>FlexGridPdfConverter.export</b> method and
    provide a reference to the grid that will be exported,
    the file name, and extra options to define the
    page format, headers and footers, and styles.
</p>

<button id="btnExport" class="btn btn-default">
    Export to PDF
</button>
<button id="btnCreateDoc" class="btn btn-default">
    Create PDF Document
</button>

@(Html.C1().FlexGrid().Id("theGrid")
    .Bind(Model)
    .AutoGenerateColumns(false)
    .Columns(cs =>
    {
        cs.Add().Binding("Id").Header("ID").Width("60");
        cs.Add().Binding("Country").Header("Country").Width("2*");
        cs.Add().Binding("Sales").Header("Sales").Width("*").Format("n2");
        cs.Add().Binding("Expenses").Header("Expenses").Width("*").Format("n2");
    })
    .Height(250)
    .Filterable() // add a filter to show that it works while exporting
)