0

我的报告不接受该参数。

我创建了一个带有“城市”名称的参数。在我的代码中,我想填写它:

ReportDocument crystalReport = new ReportDocument();
crystalReport.Load(Server.MapPath("CrystalReport.rpt"));
crystalReport.SetParameterValue("City", lblCiudad.Text);
viewer.ReportSource = crystalReport;

问题是报告没有用我的参数过滤,没有它就显示。

4

1 回答 1

0

用公式解决:

crystalReportViewer.SelectionFormula = "{Clientes.Nombre} = '" + nombreCliente + "' AND {Registros.Host} = '" + host + "' AND  {Registros.Servicio} = '" + service + "' AND {Registros.Fecha} <= " + "DateTime(" + fF.Year.ToString() + "," + fF.Month.ToString() + "," + fF.Day.ToString() + ","+fF.Hour.ToString() + "," + fF.Minute.ToString()+","+fF.Second.ToString()+") AND {Registros.Fecha} >= " + " DateTime(" + fI.Year.ToString() + "," + fI.Month.ToString() + "," + fI.Day.ToString() + ","+fI.Hour.ToString() + "," + fI.Minute.ToString()+","+fI.Second.ToString()+")";
于 2013-09-13T14:54:17.813 回答