如何配置 ReportViewer 以便它可以在 ASP.NET 中导出 CSV? [英] How to configure ReportViewer so it can be exported CSV in ASP.NET?

查看:45
本文介绍了如何配置 ReportViewer 以便它可以在 ASP.NET 中导出 CSV?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何配置 ReportViewer 以便它可以在 ASP.NET 中导出 CSV(来自 VisualStudio 2005/2008 的 ReportViewer)?所以它将是当前下拉列表的一部分?目前,它仅适用于 Excel 和 PDF,但不适用于 CSV.

How to configure ReportViewer so it can be exported CSV in ASP.NET (ReportViewer that comes from VisualStudio 2005/2008)? So it will be apart of current drop downlist? At the moment, it's only for Excel and PDF but not CSV.

谢谢

推荐答案

在本地模式下运行报表查看器时,您无法导出到 PDF 和 Excel 以外的任何内容.如果您希望能够导出为其他格式,则需要在服务器模式下运行报表查看器.然后通过扩展在 SQL 服务器上完成渲染.

When you run Report Viewer in Local mode, you cannot export to anything other than PDF and Excel. If you want to be able to export to other formats, you need to run Report Viewer in Server Mode. The rendering is then done on the SQL server through extensions.

让报表查看器在本地模式下导出其他格式的唯一方法是覆盖渲染类,基本上自己编写一个渲染器.这相当复杂.

The only way to make Report Viewer export other formats in local mode, is by overriding the render class, and basically write a renderer yourself. This is quite complicated.

附带说明,您还可以通过反射启用 Word 和 HTML 呈现.然而,通过这种技术渲染图像有点粗略.我尝试这样做,但图像无法正确呈现.

On a side note, you can also enable Word and HTML rendering through Reflection. Howerver, the rendering of images through this technique is a little sketchy. I tried doing this, and the images would not render properly.

这篇关于如何配置 ReportViewer 以便它可以在 ASP.NET 中导出 CSV?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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