修改导出到Excel中的ReportViewer [英] Modifying Export to Excel in ReportViewer

查看:1109
本文介绍了修改导出到Excel中的ReportViewer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在的ReportViewer一个格式化的表格。当我想虽然导出到Excel - 我不想导出格式的表 - 而不是我要输出的原始/生/ unmassaged数据表中的Excel文件

I have a formatted table in ReportViewer. When I want to export to Excel though - I do not want to export the formatted table - instead I want to output the original/raw/unmassaged data table in an excel file.

什么是拦截导出到Excel的功能和输出数据以不同的格式的最佳方式?

What's the best way to intercept the Export to Excel function and output data in a different format?

推荐答案

ShowExportButton 在的ReportViewer并在页面做的工作增添一个新的按钮。

Put the ShowExportButton to False in the ReportViewer and add a new button in your page that do the work.

或者你也可以进入 ReportExport 事件,将取消以,火你自定义的方法

Or you can get into the ReportExport event, set the Cancel to True, and the fire your custom method.

Private Sub ReportViewer1_ReportExport(ByVal sender As Object, _
           ByVal e As Microsoft.Reporting.WinForms.ReportExportEventArgs) _
           Handles ReportViewer1.ReportExport
    e.Cancel = True
End Sub

这篇关于修改导出到Excel中的ReportViewer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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