@model IEnumerable<FlexGridData.Sale>

<h1>
    Export to XLSX
</h1>
<p>
    To export FlexGrid controls to the XLSX format, you
    should include following extra modules in your application:
</p>
<ol>
    <li>
        <b><a href="https://stuk.github.io/jszip/" target="_blank">jszip.js</a></b>:
        Javascript library for creating, reading and editing ZIP files.
    </li>
</ol>
<p>
    To export FlexGrid to XLSX, call the
    <b>FlexGridXlsxConverter.save</b> method to obtain a 'book'
    object. You may modify the book object before saving it. For example,
    you may add or rename sheets. Once the 'book' is ready, 
    call its <b>save</b> method to create the XLSX file.
</p>

<button id="btnExport" class="btn btn-default">
    Export to XLSX
</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
)

@section Scripts{
    <script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jszip/2.5.0/jszip.min.js"></script>
}