Overview

Overview

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

Features

Id
Date
Time
Country
Downloads
Sales
Expenses
Checked
0
Jun/06/2015
2:39 AM
Japan
384
8,916.44
2,699.60
1
Jun/05/2015
9:56 AM
Germany
466
2,919.65
3,748.77
2
Nov/08/2015
6:21 PM
UK
287
7,139.30
2,849.48
3
May/05/2015
9:02 PM
Greece
416
1,348.32
1,693.62
4
Aug/01/2015
7:08 PM
Greece
869
1,090.70
1,248.60
5
May/21/2015
9:26 PM
Germany
279
4,902.03
3,031.26
6
Jan/14/2015
7:59 AM
UK
633
654.97
3,848.56
7
Aug/13/2015
3:00 AM
Greece
437
8,364.12
2,963.30
8
Dec/20/2015
1:38 AM
Germany
224
1,662.96
877.49
9
Jan/09/2015
6:41 PM
Greece
612
2,496.89
729.93
10
Jul/14/2015
7:55 PM
US
648
9,844.40
3,012.47
11
Aug/04/2015
9:01 AM
Japan
148
182.77
180.80
12
Jun/06/2015
1:19 PM
Japan
129
7,128.33
4,480.94
13
Sep/18/2015
6:03 PM
UK
738
7,640.02
3,370.60
14
Jan/10/2015
11:29 AM
Germany
650
4,505.98
1,561.26

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
22
23
24
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.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 ActionResult Index()
        {
            ViewBag.Options = _flexGridModel;
            return View();
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
@using WebApiExplorer.Models
@{
    GridExportImportOptions optionsModel = ViewBag.Options;
    ViewBag.DemoSettings = true;
}
 
<div id="@(optionsModel.ControlId)" style="height:300px"></div>
@section Settings{
    @Html.Partial("_FlexGridOptions", optionsModel)
}
<script>
    var grid = new wijmo.grid.FlexGrid('#@(optionsModel.ControlId)');
    initializeFlexGrid(grid);
</script>
@section Description{
    @Html.Raw(Resources.Wijmo5FlexGrid.Index_Text0)
}