日期:2014-05-18 浏览次数:20887 次
ParameterFields parameterFields = LoadOrderInfo(orderInfo); this.crystalReportViewer1.ParameterFieldInfo = parameterFields; private ParameterFields LoadOrderInfo(receiveShipmentOrder orderview) { ParameterFields orderInfo = new ParameterFields(); if (orderview != null) { orderInfo.Add(GetParameterField("supplierName", orderview.supplier.name)); orderInfo.Add(GetParameterField("name", orderview.createUser.name)); string state=""; orderInfo.Add(GetParameterField("state", state)); orderInfo.Add(GetParameterField("receiveCode", orderview.code)); } return orderInfo; } //设置参数字段 private ParameterField GetParameterField(string name, string value) { ParameterField field = new ParameterField(); ParameterDiscreteValue fieldValue = new ParameterDiscreteValue(); field.ParameterFieldName = name; fieldValue.Value = value; field.CurrentValues.Add(fieldValue); return field; }