如何在回发时刷新报表查看器报表

问题描述 投票:1回答:3

我在VS2012 asp.net中有一个简单的报告,它来自一个.rdlc文件,它以月份和年份为参数,从各自的下拉列表中提取。我已将下拉菜单设置为autopostback,但我的报告并未刷新以反映新参数。在调试中,它甚至没有命中检索数据的方法。

我刚接触.net报道,所以任何帮助都会受到赞赏。我需要调用特殊方法来使用新参数重新加载报告吗?

asp.net .net reportviewer rdlc
3个回答
3
投票

您可以使用此代码

ReportViewer1.LocalReport.Refresh()

1
投票

这对我有用。即在ReportViewerWebForm.aspx.cs中

DropDownList1_SelectedIndexChanged(Object sender,EventArgs e) 
{
    ReportViewer1.LocalReport.Refresh();
}

0
投票

我已经使用过这段代码并且运行良好,希望有用! xReportViewer1.docViewer.DocumentSource = null;

© www.soinside.com 2019 - 2024. All rights reserved.