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

Visibility of SubReport

1 Answer 185 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
simon
Top achievements
Rank 1
simon asked on 11 Dec 2007, 11:08 AM
Hello telerik team,

first of all - great reporting tool that you wrote.
I have already read the threads about to hide space where no data is shown, but it didn“t solve my problem.

I also have a subreport which not always shows data. If the subreport has no data - of course it should not show the vertical space which is occupied by the textboxes when data is bound to the subreport.

I already tried setting the visible-property to false or to clear the control collection in the _ItemDataBound Eventhandler of the subreport or also in the _NeedDataSource Eventhandler of the parent report but it is regardless the same.

Thank you in advance,
Simon


1 Answer, 1 is accepted

Sort by
0
simon
Top achievements
Rank 1
answered on 11 Dec 2007, 05:55 PM
Thank you. I solved the problem.

I set "visible=false" in the _NeedDataSource-Eventhandler to the InnerReport of the subreport instead of setting it to the subreport itself.

private void subReport1_NeedDataSource(object sender, EventArgs e)
{
            Telerik.Reporting.Processing.SubReport subrpt =                        (Telerik.Reporting.Processing.SubReport)sender;
            //subrpt.InnerReport.Visible = false;
            subrpt.Visible = false;
}

Then I made the Detail Section of the report smaller (so the subreport is hidden) and everything looks good.

Simon
Tags
General Discussions
Asked by
simon
Top achievements
Rank 1
Answers by
simon
Top achievements
Rank 1
Share this question
or