关于#layui#的问题,如何解决?

我用layui写了一个查学生基本信息
然后前端可以展现看板信息
现在我想写一个导出按钮
可以将看板信息以Word文档的形式导出
我该怎么办
麻烦各位了

你后端生成一个excel文件,前端下载文件就好了。当然前端也可以生成excel,就是用户的机器性能不一定能满足,一些情况下可能会卡死什么的。


//如果使用asp gridview可以用以下方法
string fileName="word文件名";
HttpContext.Current.Response.Charset = "GB2312";
HttpContext.Current.Response.ContentEncoding = Encoding.UTF8;
HttpContext.Current.Response.ContentType = "application/ms-winword";
HttpContext.Current.Response.AppendHeader("Content-disposition", "attachment;filename=" + fileName + ".doc");
//gridviewID名称为gridviewID
gridViewID.EnableViewState = false;
StringWriter sw = new StringWriter();
HtmlTextWriter tw = new HtmlTextWriter(sw);
gridViewID.RenderControl(tw);
HttpContext.Current.Response.Write(sw.ToString());
HttpContext.Current.Response.End();

//不是的话如果想要后台导出可以找找相关的类库npoi,spire等,要前端导出就找找导出用的js插件