This is a migrated thread and some comments may be shown as answers.

Empty Space From Nested Subreport within a Subreport

1 Answer 195 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Warren
Top achievements
Rank 2
Warren asked on 27 May 2009, 02:33 PM
Development Environment:  VS Studio 2005, ASP.NET, VB.NET, Telerik Reporting v3.0.9.430

Problem: Trying to hide empty space of a subreport which resides within a subreport.

Attempts so far:  Tried setting height of the detail section of both sub reports to 0.01 within the constructor.  Have all text boxes property CanShrink set to True.

Report Design Look:

Main Report:
-------------------------------------------------
Report Header Section
-------------------------------------------------
Detail Section with Text Boxes
SubReport1
-------------------------------------------------

SubReport1 (w/Header/Footer Visible=False):
-------------------------------------------------
Detail Section with Text Boxes
          SubReport2
-------------------------------------------------

SubReport2 (w/Header/Footer Visible=False):
-------------------------------------------------
Detail Section with only one Text Box (CanShrink=True)
-------------------------------------------------


Code for both SubReport1 and SubReport2:
Public Sub New()  
    InitializeComponent()  
    Me.DetailSection1.Height = Unit.Inch(0.01)  
    Me.DataSource = Nothing 
End Sub 


Report Output:
By setting the border for the detail section of SubReport1 and SubReport2 I can see that SubReport2 is hidden yet SubReport1's detail section is still expanded for the content of SubReport2.  This report has mutliple rows returned and only a few rows will contain data within SubReport2.  SubReport1 always has data

Here is an example of what it should look like:

                              Example Report 1
Patients for: Dr. Bob Burns
Name                  DOB                   Age                   Gender
Bob Smith           01/01/1974        35                      Male
Nancy Apple       05/01/1976        33                      Female
          Here are some notes for Nancy Apple
Joe Johnson       03/25/1978        31                      Male


Here is what is really produced by the report:

                              Example Report 1
Patients for: Dr. Bob Burns
Name                  DOB                   Age                   Gender
Bob Smith           01/01/1974        35                      Male

Nancy Apple       05/01/1976        33                      Female
          Here are some notes for Nancy Apple
Joe Johnson       03/25/1978        31                      Male


Any help is greatly appreciated.

Warren

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 29 May 2009, 03:50 PM
Hi Warren,

Thank you for the incredibly thorough explanation of what you're aiming for. Setting incredibly lower value for the height of the detail section is ok, but the subreport item that holds the report has height as well. Every container item ( like section, panel and subreport) can grow to accommodate their children but cannot shrink on their own if there is no content. So basically setting the subreport's item height to 0.01 in should resolve this.

All the best,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
General Discussions
Asked by
Warren
Top achievements
Rank 2
Answers by
Steve
Telerik team
Share this question
or