在下面的代码中,我收到一条错误消息“无法以声明方式设置'DisplayGroupTree'属性。”这是在我为visual studio 2015安装SAP crystal报告之后发生的。
<CR:CrystalReportViewer ID="CrvDisplay" runat="server" AutoDataBind="true" DisplayGroupTree="False"
ReuseParameterValuesOnRefresh="True" EnableDatabaseLogonPrompt="false" EnableParameterPrompt="false" />
如果我删除DisplayGroupTree =“False”,那么我不会收到此错误...下方附加屏幕截图
![ Error Missing parameter values.] 1
protected void Page_Init(object sender, EventArgs e)
{
ConfigureCrystalReports();
}
private void ConfigureCrystalReports()
{
ReportDocument cryRpt = new ReportDocument();
TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();
ConnectionInfo crConnectionInfo = new ConnectionInfo();
Tables CrTables;
cryRpt.Load(Server.MapPath(Session["Reportname"].ToString()));
//DB Connection Start
string Server1 = ConfigurationManager.AppSettings["Server"];
string user = ConfigurationManager.AppSettings["Userid"];
string Password = ConfigurationManager.AppSettings["Password"];
string DataBase = ConfigurationManager.AppSettings["DataBase"];
crConnectionInfo.ServerName = Server1;
crConnectionInfo.DatabaseName = DataBase;
crConnectionInfo.UserID = user;
crConnectionInfo.Password = Password;
////Parameter setting Start
ParameterDiscreteValue pmtDiscValue1 = new ParameterDiscreteValue();
pmtDiscValue1.Value = Session["LowerboundDate"];
cryRpt.ParameterFields["LowerboundDate"].CurrentValues.Add(pmtDiscValue1);
ParameterDiscreteValue pmtDiscValue2 = new ParameterDiscreteValue();
pmtDiscValue2.Value = Session["UpperboundDate"];
cryRpt.ParameterFields["UpperboundDate"].CurrentValues.Add(pmtDiscValue2);
////Parameter setting End
CrTables = cryRpt.Database.Tables;
foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
{
crtableLogoninfo = CrTable.LogOnInfo;
crtableLogoninfo.ConnectionInfo = crConnectionInfo;
CrTable.ApplyLogOnInfo(crtableLogoninfo);
}
CrvDisplay.SelectionFormula = Session["selectionformula"].ToString();
CrvDisplay.ReportSource = cryRpt;
CrvDisplay.RefreshReport();
}
答案 0 :(得分:1)
如@jambonick所说,该命令已过时
尝试使用
YOURReportViewer1.ToolPanelView = CrystalDecisions.Web.ToolPanelViewType.None;