【问题标题】:Kendo UI Export Excel file With More Information(not only grid)Kendo UI 导出具有更多信息的 Excel 文件(不仅是网格)
【发布时间】:2015-05-20 08:09:56
【问题描述】:

我正在使用 Kendo UI 并将报告导出到 Excel。代码如下 剑道 UI 网格:

   <html>
     @(Html.Kendo().Grid<Futuresteps.Media.Models.WorkingTargetInDoorDetail>()
    .Name("grid")
    .Columns(columns =>
    {

                columns.Bound(indoor => indoor.ID).Width(100).HtmlAttributes(new { @class = "tdid" });
                columns.ForeignKey(indoor => indoor.MediaTypeID, (System.Collections.IEnumerable)ViewBag.MediaTypeID, "RegistrationID", "MediaTypeName").Width(200).Title("Media");
                columns.ForeignKey(indoor => indoor.channel, (System.Collections.IEnumerable)ViewBag.ChannelID, "RegistrationID", "ChannelName").Width(200).Title("Channel");
                columns.Bound(indoor => indoor.EntryDate).Width(200).Format("{0:d}").Title("Entry Date");
      })
     .ToolBar(toolBar =>
      {
           toolBar.Excel();
    })
    .Excel(excel => excel
        .FileName("Indoor Media Report.xlsx")
        .Filterable(true)
        .ProxyURL(Url.Action("Excel_Export_Save", "WorkingTargetInDoorDetail"))
      )
    </html>

MVC 导出方法: [HttpPost] 公共 ActionResult Excel_Export_Save(字符串内容类型,字符串 base64,字符串文件名) { var fileContents = Convert.FromBase64String(base64); 返回文件(文件内容,内容类型,文件名); }

它正在工作,我得到了正确的 excel 文件报告,但是这个 excel 文件只包含网格,我想在 excel 文件中的网格之前添加一些更多信息,例如表格标题,excel 文件中网格之前的通道名称 谁能帮帮我?

【问题讨论】:

    标签: jquery kendo-ui grid


    【解决方案1】:

    other thread 的方法也适用于当前任务。 excelExport 事件可用于修改导出的工作簿并添加所需的信息。

    【讨论】:

      猜你喜欢
      • 2015-02-22
      • 2017-04-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多