How to expand all items in a reportviewer object ?

Hi,

Is there an event, a method, a property or something to expand all items of a report

I'm working with a local report i just want to allow the user to expand or collapse all the report details.

I'm also having the same kind of problem when I export it, the first level of item appear expand but not the other levels.

Thanks



Answer this question

How to expand all items in a reportviewer object ?

  • Jeff Patton

    Thanks a lot.

    Just if somebody else try to do it, here what i did :

    ExpandEmployee is a ReportParameter of type string

    On aspx.cs file (onclick button )

    ReportParameter[] param = new ReportParameter[1];

    param[0] = new ReportParameter("ExpandEmployee", 1);

    this.ReportViewer1.LocalReport.SetParameters(param);

    ReportViewer1.LocalReport.Refresh();

    On your report :

    In initiateToggle : =IIF(Parameters!ExpandEmployee.Value.ToString ="1",False, True)

    In visibility -> Hidden : =IIF(Parameters!ExpandEmployee.Value.ToString ="1",False, True)


  • Karlo

    I'm having the same issue but don't understand the solution.
    Where exactly do I have to enter the code:

    In initiateToggle : =IIF(Parameters!ExpandEmployee.Value.ToString ="1",False, True)
    In visibility -> Hidden : =IIF(Parameters!ExpandEmployee.Value.ToString ="1",False, True)

    And what is initiateToggle Is it a method created by you Couldn't find anything about it on the net.

    kind regards
    Kuti

  • PaulMD

    OK got it:
    select a row in a table, rightclick - "edit group" - "visibility" - "Expression", then enter:
    =IIF(Parameters![Parametername].Value.ToString ="1",False, True)

    (translated from German to English)


  • Wayne.C

    There is no method on the report viewer object that will do this, but you can get a similar effect by configuring your toggle options to expand when a given report parameter is set to true. You could set that parameter using ReportViewer.LocalReport.SetParameters().
  • How to expand all items in a reportviewer object ?