Features

Excel Service

Excel Service

Import and export FlexSheet to an Excel file by using the Web API Edition Excel Service.

Features

Excel Service

This sample demonstrates how to import and export FlexSheet to an Excel file by using the Web API Edition Excel Service.

Export & Import
Export Name :
using Microsoft.AspNetCore.Mvc;

namespace FlexSheetExplorer.Views.FlexSheet
{
    public partial class FlexSheetController : Controller
    {
        public ActionResult ExcelService()
        {
            return View();
        }
    }
}
@section Scripts{
<script src="~/Scripts/wijmo.io/webapiclient.min.js"></script>
<script src="~/Scripts/flexSheet/excelService.js"></script>
<script>
    ctx.serverUrl = '@AppSettings.GetWebApiServiceUrl()';
</script>
}
<div>
    <div class="copy">
        <h3>
            @Html.Raw(FlexSheetRes.ExcelService_Text2)
        </h3>
<p>@Html.Raw(FlexSheetRes.ExcelService_Text0)</p>

        <c1-flex-sheet id="excelServiceSheet" class="flexSheet" file-path="~/Content/xlsxFile/example1.xlsx"></c1-flex-sheet>

        <div class="panel panel-warning">
            <div class="panel-heading">@Html.Raw(FlexSheetRes.ExcelService_Text5)</div>
            <div class="panel-body">
                <div class="row">
                    <c1-menu id="exportFormat" header="Export Format: <b>XLSX</b>"
                             execute-command="exportFormatChanged">
                        <c1-menu-item header="XLSX" command-parameter="@("Xlsx")"></c1-menu-item>
                        <c1-menu-item header="XLS" command-parameter="@("Xls")"></c1-menu-item>
                        <c1-menu-item header="CSV" command-parameter="@("Csv")"></c1-menu-item>
                    </c1-menu>
                    <span>@Html.Raw(FlexSheetRes.ExcelService_Text6)</span>
                    <input id="exportName" type="text" class="form-control input-control" value="export" />
                    <button class="btn btn-primary" onclick="exportFlexSheet()">@Html.Raw(FlexSheetRes.ExcelService_Text3)</button>
                </div>
                <div class="row">
                    <input type="file" id="fileinput" class="form-control input-control" />
                    <button class="btn btn-primary" onclick="importFlexSheet()">@Html.Raw(FlexSheetRes.ExcelService_Text4)</button>
                </div>
            </div>
        </div>
    </div>
</div>
@section Summary{
<p>@Html.Raw(FlexSheetRes.ExcelService_Text1)</p>

}