Overview

Overview

This sample demonstrates how to export a wijmo5 flexgrid to excel file.

Features

Id
Date
Time
Country
Downloads
Sales
Expenses
Checked
0
Oct/24/2015
6:36 AM
UK
568
859.07
1,770.79
1
May/25/2015
8:50 AM
UK
805
3,481.55
1,288.92
2
Jan/19/2015
6:51 AM
US
589
1,808.25
2,945.91
3
Aug/03/2015
11:35 PM
Greece
101
7,892.11
1,708.90
4
May/16/2015
8:35 PM
Germany
926
5,454.60
84.85
5
Dec/13/2015
4:30 PM
Greece
184
4,199.28
3,442.84
6
Oct/05/2015
12:13 PM
UK
234
1,934.58
1,383.47
7
Dec/22/2015
7:32 PM
US
657
6,032.96
4,729.37
8
Sep/15/2015
6:43 PM
Japan
861
7,502.40
4,390.11
9
Jul/16/2015
12:53 PM
UK
513
5,139.03
4,730.66
10
Sep/02/2015
6:34 AM
US
612
1,482.37
2,257.13
11
Dec/08/2015
2:16 PM
US
589
2,703.74
1,558.78
12
Mar/03/2015
2:47 AM
Germany
94
6,182.13
4,426.85
13
May/18/2015
4:09 AM
UK
968
2,138.72
2,162.65
14
Nov/01/2015
1:01 AM
US
830
7,771.79
1,236.17

Settings


Export & Import
Export Name :           

Description

This sample demonstrates how to export a wijmo5 flexgrid to excel file.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
using Microsoft.AspNetCore.Mvc;
using WebApiExplorer.Models;
  
namespace WebApiExplorer.Controllers
{
    public partial class Wijmo5FlexGridController : Controller
    {
        private readonly GridExportImportOptions _flexGridModel = new GridExportImportOptions
        {
            NeedExport = true,
            NeedImport = true,
            IncludeColumnHeaders = true
        };
  
        public IActionResult Index()
        {
            ViewBag.Options = _flexGridModel;
            return View();
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
@{
    GridExportImportOptions optionsModel = ViewBag.Options;
    ViewBag.DemoSettings = true;
}
  
<div id="@(optionsModel.ControlId)" style="height:300px"></div>
@section Settings{
    @await Html.PartialAsync("_FlexGridOptions", optionsModel)
}
<script>
    var grid = new wijmo.grid.FlexGrid('#@(optionsModel.ControlId)');
    initializeFlexGrid(grid);
</script>
@section Description{
    @Html.Raw(Wijmo5FlexGrid.Index_Text0)
}