简体   繁体   English

ASP.Net ReportViewer控件不起作用

[英]ASP.Net ReportViewer control not working

I am using Reportviewer control in my .aspx page. 我在.aspx页中使用Reportviewer控件。 I set 我设置

  ReportViewer1.ShowPrintButton = false;

but it didn't work. 但这没用。 Not only this button, i tried to show refresh button but it didn't work. 我不仅尝试了该按钮,还尝试显示“刷新”按钮,但是它没有起作用。 thanks. 谢谢。

protected void Page_Load(object sender, EventArgs e) {

  if (!this.IsPostBack)
    PrintReport();
}
  private void PrintReport() {
    ReportViewer1.ShowPrintButton = false;
    ReportViewer1.ShowRefreshButton = false;
  }

You need to be running reports in remote mode in order for the buttons to work. 您需要在远程模式下运行报表才能使按钮起作用。 In addition, if you want them to be shown, you have to set the values to True, not False as is shown in your code. 另外,如果要显示它们,则必须将值设置为True,而不是代码中所示的False。

If you are running in local mode, there is an ActiveX control that can be downloaded, but this will only work for IE. 如果以本地模式运行,则可以下载ActiveX控件,但这仅适用于IE。

Here is a link to the MSDN documentation about printing from ReportViewer that should help you out. 这是有关从ReportViewer打印的MSDN文档的链接,该链接可以为您提供帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM