如何GridView控件输出保存到一个图像? [英] How to save GridView output to an Image?

查看:181
本文介绍了如何GridView控件输出保存到一个图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发一个Web应用程序仪表板,仪表盘显示不同的图(Telerik的RadChart)图像和GridView表。见下图:

I am developing a Dashboard for a web application , dashboard shows various Chart (Telerik RadChart) Images and GridView Tables. See below image:

)

要提高我们的仪表板实现缓存仪表盘装载性能。

To increase performance of dashboard loading we are implementing Caching for dashboard.

我们正在创造从RadChart日常JPEG图像,并在服务器上的文件夹中存储,这些图像都可以整天在缓存,第二天他们变脏和再生的Dashboad负载。

We are generating jpeg images from RadChart everyday and storing in a folder on server, these images are available whole day in caching, next day they gets dirty and regenerated on Dashboad load.

我能够成功RadChart导出为图片,但不知道如何GridView的输出导出为图片。

I am able to successfully export RadChart to images but don't know how to export GridView output as images.

让我知道如果你需要更多的信息。

Let me know if you need more information.

推荐答案

我会说去了解这一点的最好办法是:

I would say the best way to go about this would be to:


  1. 生成GridView控件为HTML。您可能必须通过你的数据循环并将其作为一个HTML表格来手动完成。

  1. Generate the gridview as html. You may have to manually do this by looping through your data and outputting it as an html table.

渲染输出的HTML作为一个图像。

Render your outputted html as an image.

下面是解释HTML转换为图像的链接 C#。

Here is a link that explains converting html to images in c#.

否则必须通过这个答案转换成GridView的形象。看来你的问题是相当普遍的。

Otherwise have a look through this answer Converting gridview into image. It seems your question is quite common.

这篇关于如何GridView控件输出保存到一个图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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