Skip to Content
0
Former Member
Feb 04, 2009 at 05:00 PM

Hide a section at runtime

23 Views

I am trying to allow the user to hide a group header or footer at runtime and am getting a report area not found error. Here is the code.

private Area GetGroupArea(ReportDocument report, string name)

{

foreach (Area area in report.ReportDefinition.Areas)

{

if (string.Compare(area.Name, name, true) == 0)

{

Debug.WriteLine(area.Sections.Count.ToString());

Debug.WriteLine(area.Kind.ToString());

area.AreaFormat.EnableHideForDrillDown = false;

return area;

}

}

return null;

}

I pass in the name of the group header and it is found. What is where is that the Debug statements work without a problem, when it gets to the line to set EnableHideForDrillDown = false it throws an exception. "Report Area Not Found"

Anyone have any ideas?

Edited by: Vince Varallo on Feb 4, 2009 6:00 PM