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

Setting height of SubReport

5 Answers 403 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mercell
Top achievements
Rank 2
Mercell asked on 20 Jul 2007, 09:14 AM
Hi,

I have a report with a subreport. The subreport contains some textboxes that may of may not be shown depending on wether they contain data or not. The textboxes that contains data is correctly shiftet upwards (where the textboxes without data was placed) leaving no empty space between the textboxes in the subreport. The problem is that there is a lot of empty space under the textboxes in the subreport. I have tried to set the height of the subreport in it's ItemDataBinding and ItemDataBound events but apparently that is not possible.

private void detail_ItemDataBound(object sender, System.EventArgs e)  
{  
    Telerik.Reporting.Processing.DetailSection detailSection = (Telerik.Reporting.Processing.DetailSection)sender;  
    detailSection.Height.Subtract(new Telerik.Reporting.Drawing.Unit(2.0, Telerik.Reporting.Drawing.UnitType.Cm));  
}  
 
private void detail_ItemDataBinding(object sender, System.EventArgs e)  
{  
    Telerik.Reporting.Processing.DetailSection detailSection = (Telerik.Reporting.Processing.DetailSection)sender;  
    detailSection.Height.Subtract(new Telerik.Reporting.Drawing.Unit(2.0, Telerik.Reporting.Drawing.UnitType.Cm));  

How do I adjust the height of the subreport to fit it's content?

Thanks

5 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 20 Jul 2007, 04:55 PM
Hi Bo,

If we understand you correctly, you want no blank space in the DetailSection's of your sub-report. Can you try setting the Height of the DetailSection of the Report acting as a sub-report (not the SubReport item in the Master Report) to something very small, say 0.1 inch, or to the height of the TextBox? Sections can grow to accommodate their children, but they cannot shrink to hide the empty space. This way, the DetailSection will grow as much as needed.

If you still have problems, can you please send us this report so that we can take a look at its layout? You can do so in a new support ticket.

 
Sincerely yours,
Rossen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Mercell
Top achievements
Rank 2
answered on 22 Jul 2007, 02:32 PM
Hi Rossen

You understood me correctly. Setting the height of the DetailSection of the sub-report solved the problem.

The only problem is that I now can't see the child controls in the designer i Visual Studio (without having to change the height again). But that is a minor problem.

A thrink facility of the DetailSection would be appreciated in a future release.

Thanks,
Bo
0
Rossen Hristov
Telerik team
answered on 23 Jul 2007, 08:27 AM
Hello Bo,

You can leave the height of the DetailSection as it was originally, and set it with code it in the report constructor after the InitializeComponent method call. This way it will be applied only at run-time and you will have "normal" design-time.

 
Sincerely yours,
Rossen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Zeeshan
Top achievements
Rank 1
answered on 26 Jul 2007, 11:51 PM
Thanks that apparently helped me as well. I was wondering why i was getting an extra space. I dont think this was documented anywhere.
0
Rossen Hristov
Telerik team
answered on 27 Jul 2007, 07:57 AM
Hi Zeeshan,

We will log that issue for documentation.

All the best,
Rossen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
General Discussions
Asked by
Mercell
Top achievements
Rank 2
Answers by
Rossen Hristov
Telerik team
Mercell
Top achievements
Rank 2
Zeeshan
Top achievements
Rank 1
Share this question
or