Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS2012 Crystal Report Viewer Group Tree Hide

Asp.Net. Webform with a CrystalDecisions.Web, Version=13.0.2000.0 CrystalReportsViewer.

I want to hide / disable the L.H. Pane containing the Group Tree Button.

The DisplayGroupTree property is marked as obsolete and has no effect.

I have set ToolPanelView="None" that also has no effect.

The hiding of Group Tree problem has existed from earlier versions but published answers do not work or translate to this version as far as I can see.

Maybe I am building the report wrong. (it displays OK).

 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();
    }
like image 648
Bob Clegg Avatar asked Dec 02 '22 18:12

Bob Clegg


2 Answers

try To Turn off:

CrystalReportViewer.ToolPanelView = ToolPanelViewType.None

To Turn on:

CrystalReportViewer.ToolPanelView = ToolPanelViewType.GroupTree

group button will appear in both

like image 138
E R Avatar answered Dec 24 '22 07:12

E R


Bob,

have you tried the HasToggleGroupTreeButton="False" property? I believe that will get rid of the button and the panel.

Give it a try and let me know if it works.

Chris

like image 32
campagnolo_1 Avatar answered Dec 24 '22 07:12

campagnolo_1