1
水晶報表顯示參數當加載報表時提示。加載水晶報表時顯示參數提示
我加載報告準則是: -
TableLogOnInfo logOnInfo = new TableLogOnInfo();
logOnInfo.ConnectionInfo.ServerName = System.Configuration.ConfigurationManager.AppSettings["ServerName"];
logOnInfo.ConnectionInfo.DatabaseName = System.Configuration.ConfigurationManager.AppSettings["DBName"];
logOnInfo.ConnectionInfo.IntegratedSecurity = false;
logOnInfo.ConnectionInfo.UserID = System.Configuration.ConfigurationManager.AppSettings["UID"];
logOnInfo.ConnectionInfo.Password = System.Configuration.ConfigurationManager.AppSettings["PWD"];
foreach (CrystalDecisions.CrystalReports.Engine.Table tbl in SchoolExpenseReport.ReportDocument.Database.Tables)
tbl.ApplyLogOnInfo(logOnInfo);
ParameterValues pvSchoolExpense = new ParameterValues();
ParameterDiscreteValue pdvFomDate = new ParameterDiscreteValue();
ParameterDiscreteValue pdvToDate = new ParameterDiscreteValue();
pdvFomDate.Value = txtFromDate.Text;
pdvToDate.Value = txtToDate.Text;
SchoolExpenseReport.ReportDocument.DataDefinition.ParameterFields["FromDate"].CurrentValues.Clear();
pvSchoolExpense.Add(pdvFomDate);
SchoolExpenseReport.ReportDocument.DataDefinition.ParameterFields["FromDate"].ApplyCurrentValues(pvSchoolExpense);
SchoolExpenseReport.ReportDocument.DataDefinition.ParameterFields["ToDate"].CurrentValues.Clear();
pvSchoolExpense.Add(pdvToDate);
SchoolExpenseReport.ReportDocument.DataDefinition.ParameterFields["ToDate"].ApplyCurrentValues(pvSchoolExpense);
SchoolExpenseReportViewer.ReportSource = SchoolExpenseReport;
SchoolExpenseReportViewer.DataBind();
SchoolExpenseReportViewer.RefreshReport();
SchoolExpenseReport.Visible = true;
顯示參數提示如下
哪裏是一個問題嗎? –
我認爲問題在於OP提供了參數值,但報告仍然在提示他們(它不應該這樣做)。 –