我想将参数传递给我的报告视图。我有一个包含数据库值的下拉列表和一个用于在从下拉列表中选择项目后显示报告的按钮。
这是我为添加参数而编写的代码
protected void Button1_Click(object sender, EventArgs e)
{
RenderReport();
}
protected void RenderReport()
{
try
{
ServerReport serverReport = ReportViewer1.ServerReport;
ReportViewer1.ProcessingMode = ProcessingMode.Remote;
try
{
serverReport.ReportServerUrl = new Uri("http://hedinaily-pc/Reports_HEDI");
}
catch (Exception ex)
{
Logger.Error(ex.Message, "");
}
serverReport.ReportPath = "~/Diagrammes/PresenceTotale.rdlc";
ReportParameter employe = new ReportParameter();
employe.Name = "Employe";
employe.Values.Add(DropDownList1.SelectedValue);
ReportViewer1.ServerReport.SetParameters( new ReportParameter[] { employe });
ReportViewer1.Visible = true;
}
catch (Exception ex)
{
Logger.Error(ex.Message, "");
}
}
这是我报告的数据集
当我检查我的日志文件时,我发现了这个错误:
The attempt to connect to the report server failed. Check your connection information and that the report server is a compatible version.
谁能告诉我这个错误来自哪里。我花了几个小时在谷歌上搜索我找到了这个LINK但我无法解决它。