我正在使用视觉工作室的SAP水晶报告。第一次运行时,它与我运行时设置的数据源一起工作正常。但是当我更改缩放级别时,它会提示输入数据库名称,用户名和密码。我被困在这两天了。请帮忙
var resultData = GetExpenseData(fromDate, toDate);
ReportDocument document = new ReportDocument();
document.Load(Server.MapPath("~/Reporting/ExpenseReport.rpt"));
document.SetDataSource(resultData);
ParameterDiscreteValue param1 = new ParameterDiscreteValue();
param1.Value = fromDate;
ParameterDiscreteValue param2 = new ParameterDiscreteValue();
param2.Value = toDate;
ParameterDiscreteValue param3 = new ParameterDiscreteValue();
param3.Value = templeName;
ParameterFieldDefinitions fieldDefinitions = document.DataDefinition.ParameterFields;
ParameterFieldDefinition fromDateFieldLocation = document.DataDefinition.ParameterFields[0];
ParameterValues fromDateParameterValues = fromDateFieldLocation.CurrentValues;
fromDateParameterValues.Add(param1);
fromDateFieldLocation.ApplyCurrentValues(fromDateParameterValues);
ParameterFieldDefinition toDateFieldLocation = document.DataDefinition.ParameterFields[1];
ParameterValues toDAteParameterValues = toDateFieldLocation.CurrentValues;
toDAteParameterValues.Add(param2);
toDateFieldLocation.ApplyCurrentValues(toDAteParameterValues);
ParameterFieldDefinition templeFieldLocation = document.DataDefinition.ParameterFields[2];
ParameterValues templeParameterValues = templeFieldLocation.CurrentValues;
templeParameterValues.Add(param3);
templeFieldLocation.ApplyCurrentValues(templeParameterValues);
CrystalReportViewer1.ReportSource = document;