ASP.Net ReportViewer控件无法正常工作

时间:2021-10-02 08:22:44

I am using Reportviewer control in my .aspx page. I set

我在.aspx页面中使用Reportviewer控件。我设置

  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;
  }

1 个解决方案

#1


0  

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文档的链接,它可以帮助您解决问题。

#1


0  

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文档的链接,它可以帮助您解决问题。