asp.net(c#)水晶報表push模式下怎樣用代碼傳遞參數?
asp.net(c#)水晶報表push模式下怎樣用代碼傳遞參數?
試了幾次,開始顯示正常,但一刷新就出現 參數丟失 錯誤
------解决方案--------------------ParameterFields paramFields = new ParameterFields();
ParameterField paramUnitField = new ParameterField();
ParameterDiscreteValue unitDiscreteVal = new ParameterDiscreteValue();
paramUnitField.ParameterFieldName = "PanaUnit ";
if (Session[ "unit "] == null)
{
Session[ "unit "] = 1;
}
unitDiscreteVal.Value = int.Parse(Session[ "unit "].ToString());
paramUnitField.CurrentValues.Add(unitDiscreteVal);
paramFields.Add(paramUnitField);
ParameterField paramStartField = new ParameterField();
ParameterDiscreteValue startDateDiscreteVal = new ParameterDiscreteValue();
paramStartField.ParameterFieldName = "startDate ";
string startDate = getStartDate(Session[ "unit "].ToString());
startDateDiscreteVal.Value = startDate;
paramStartField.CurrentValues.Add(startDateDiscreteVal);
paramFields.Add(paramStartField);
ParameterField paramEndField = new ParameterField();
ParameterDiscreteValue endDateDiscreteVal = new ParameterDiscreteValue();
paramEndField.ParameterFieldName = "endDate ";
string endDate = getEndDate(Session[ "unit "].ToString());
endDateDiscreteVal.Value = endDate;
paramEndField.CurrentValues.Add(endDateDiscreteVal);
paramFields.Add(paramEndField);
crView.ParameterFieldInfo = paramFields;
------解决方案--------------------用cookie session都可以解决
------解决方案--------------------晕,帮你顶