在运行时更改ReportViewer中的报表 [英] Change report in ReportViewer at runtime

查看:79
本文介绍了在运行时更改ReportViewer中的报表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在运行时动态更改报表查看器中的报表?任何想法?

How to change the report in a report viewer dynamically at runtime? any idea?

推荐答案

只需放置/使用一个查看器并根据需要将报告源更改为它。您需要在运行时根据您的定义为查看器定义报告。

Just place/use one viewer and change the source of report to it as per need. You would need to define the report for the viewer at runtime as defined by you.
//This code will define a report at runtime
//Webforms
reportViewer1.Reset();
reportViewer1.LocalReport.ReportEmbeddedResource = MapPath("Report1.rdlc");
this.reportViewer1.RefreshReport();


这篇关于在运行时更改ReportViewer中的报表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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