在Asp.net中将MS图表导出到Excel c# [英] Export MS Chart To Excel in Asp.net c#

查看:53
本文介绍了在Asp.net中将MS图表导出到Excel c#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我的asp.net应用程序中有一个要求是导出在UI中生成的asp.net图表,以便将其导出为ex​​cel sheet.Not数据我需要导出为图形图。



如果我使用Microsoft.Interop.dll导出excel我能够实现,但问题是每个它被导出的时间必须保存在服务器位置,然后必须打开它。

在我的场景中,将有100多个用户将访问该应用程序,以便每个用户点击导出一个多个excel版本将保存在服务器路径中,它会增加服务器的空间。

所以我使用另一种方法使用Response.Write(strinwriter.tostring())。这时我导出excel图表导出到excel但是当通过mail.Chart将某个excel共享给某人时excel表格中没有。



我使用的一段代码

stringwriter oSw = new Stringwriter();

HtmlTextWriter oHw = new HtmlTextWriter(oSw);

Chart.RenderControl(oHw);

Response.write(oSw.ToString());



任何人请帮忙。



谢谢!...

Hi,

I have a requirement in my asp.net application to export the asp.net chart generated in the UI to be exported as such to a excel sheet.Not data i need to export as a pictorial graph.

If i use Microsoft.Interop.dll to export excel i am able to achieve but the problem is each time when it is exported it has to be saved in server location and then have to open it.
In my scenario there will be 100+ users will be accessing the application so for each users click to export a multiple excel version will be saved in a server path, it will increase the space in server.
so i went with another approach using Response.Write(strinwriter.tostring()).Here when i export the excel chart is exported to excel but when the same excel is shared to someone through mail.Chart is not available in the excel sheet.

Piece of code i used
stringwriter oSw=new Stringwriter();
HtmlTextWriter oHw=new HtmlTextWriter(oSw);
Chart.RenderControl(oHw);
Response.write(oSw.ToString());

Anybody please help on this.

Thanks!...

推荐答案

这个 [ ^ ]可能会帮助你。
This[^] just might help you out.


这篇关于在Asp.net中将MS图表导出到Excel c#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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