导出Html div元素到excel失败 [英] Export Html div element to excel failed

查看:68
本文介绍了导出Html div元素到excel失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在尝试将aspx页面中的div元素转换为具有另一个.js文件样式的excel。



我的代码生成excel表但是在excel表中我只得到直接html而不是UI。

我点击按钮的代码就是休闲。



Hi
I am trying to convert div element in aspx page to excel which has the style from another .js file.

my code generating excel sheet but in excel sheet i am only getting direct html only not the UI.
My code in button click is as fallows.

Response.AppendHeader("content-disposition", "attachment;filename=ExportedHtml.xls");
            Response.Charset = "";
            Response.Cache.SetCacheability(HttpCacheability.NoCache);
            Response.ContentType = "application/vnd.ms-excel";
            this.EnableViewState = false;
            Response.Write(htmltoexcel.InnerHtml.ToString());
            Response.End();





我的代码有什么问题以及如何将html div转换为excel



what is the wrong in my code and how to convert it html div to excel

推荐答案

http://stackoverflow.com/questions/9364107/export-html-table-to-excel-using-asp-net [ ^ ]


这篇关于导出Html div元素到excel失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆