gpt4 book ai didi

asp.net - VS2012 Crystal Report 查看器组树隐藏

转载 作者:行者123 更新时间:2023-12-03 18:26:16 25 4
gpt4 key购买 nike

Asp.Net。带有 CrystalDecisions.Web 的 Web 表单,版本 = 13.0.2000.0 CrystalReportsViewer。

我想隐藏/禁用包含组树按钮的 L.H. Pane 。

DisplayGroupTree 属性被标记为过时且无效。

我已经设置了 ToolPanelView="None"也没有效果。

早期版本中已经存在隐藏组树问题,但据我所知,已发布的答案不起作用或无法转换到此版本。

也许我构建的报告是错误的。 (显示正常)。

 private void ShowReport(MyClassLibrary.Report report)
{
ConnectionInfo cn = new ConnectionInfo();
cn.ServerName = "MyServer";
cn.DatabaseName = "MyDatabase";
cn.UserID = "myUser";
cn.Password = "myPassword";
string reportDirectory = Server.MapPath(".") + "\\Reports\\";
CrystalReportSource rs = new CrystalReportSource();
Session["CurrentReportSource"] = rs;
CrystalDecisions.Web.Report r = new CrystalDecisions.Web.Report();


r.FileName = reportDirectory + report.reportPath;
rs.Report = r;

CRV.ReportSource = rs;



ParameterFields p = CRV.ParameterFieldInfo;
ParameterField pUserId = new ParameterField();
pUserId.Name = "@user_id";
ParameterField pStartDate = new ParameterField();
pStartDate.Name = "@start_date";
ParameterField pEndDate = new ParameterField();
pEndDate.Name = "@end_date";

ParameterDiscreteValue pUserIdValue = new ParameterDiscreteValue();
ParameterDiscreteValue pStartDateValue = new ParameterDiscreteValue();
ParameterDiscreteValue pEndDateValue = new ParameterDiscreteValue();

TimeSpan t = new TimeSpan(30, 0, 0, 0);
DateTime startDate = DateTime.Today - t;
DateTime endDate = DateTime.Now;
//**LIVE CODE***
//CouponUser user = (CouponUser) Session["CurrentUser"];
//pUserId_Value.Value = user.userId;
//***TEST CODE***
pUserIdValue.Value = 2;
//********
pStartDateValue.Value = startDate;
pEndDateValue.Value = endDate;


pUserId.CurrentValues.Add(pUserIdValue);
pStartDate.CurrentValues.Add(pStartDateValue);
pEndDate.CurrentValues.Add(pEndDateValue);

p.Add(pUserId);
p.Add(pStartDate);
p.Add(pEndDate);


foreach (TableLogOnInfo logOnInfo in CRV.LogOnInfo)
{
logOnInfo.ConnectionInfo = cn;
}


rs.DataBind();
}

最佳答案

尝试
把关掉:

CrystalReportViewer.ToolPanelView = ToolPanelViewType.None

打开:
CrystalReportViewer.ToolPanelView = ToolPanelViewType.GroupTree

组按钮将出现在两个

关于asp.net - VS2012 Crystal Report 查看器组树隐藏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19214669/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com