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

Subreport Visibility

4 Answers 71 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Darren
Top achievements
Rank 1
Darren asked on 10 Nov 2009, 04:23 PM
Hi,

I'm trying to make subreports visible programmatically with a parameter in the _NeedDataSource event.  This is the code I am using:

            foreach (string filterRow in showHide) 
            { 
                switch(filterRow) 
                { 
                    case "10": 
                        this.textBoxEventTotals.Visible = true
                        this.subReportCommunityEventTotals.Visible = true
                        this.subReportCommunityEventTotals.Report.Visible = true
                        break; 
                    case "20": 
                        this.textBoxEventTotalsByDate.Visible = true
                        this.subReportCommunityEventTotalsByDate.Visible = true
                        this.subReportCommunityEventTotalsByDate.Report.Visible = true
                        break; 
                    case "30": 
                        this.textBoxTotalsByCommunity.Visible = true
                        this.subReportCommunityEventTotalsByCommunity.Visible = true
                        this.subReportCommunityEventTotalsByCommunity.Report.Visible = true
                        break; 
                    case "40": 
                        this.textBoxCommunityAndDate.Visible = true
                        this.subReportCommunityEventsByCommunityAndDate.Visible = true
                        this.subReportCommunityEventsByCommunityAndDate.Report.Visible = true
                        break; 
                    case "50": 
                        this.textBoxDetails.Visible = true
                        this.subReportCommunityEventDetails.Visible = true
                        this.subReportCommunityEventDetails.Report.Visible = true
                        break; 
                } 
            } 
        } 
 

The visibility of everything is set to false.  I don't seem to be able to get to the inner report of my subreport controls. Changing the visiblity of the subreport controls and text boxes works fine.  What am I doing wrong?

I know it sounds a little strange but in the subreport I was going to bail out of getting the data if the subreport wasn't visible.  That's why I want to make the subreport invisible not just the subreport control....

Thanks,
Darren

4 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 11 Nov 2009, 05:10 PM
Hi Darren ,

Maybe this is what you are looking for as better solution: http://blogs.telerik.com/telerikreportingteam/posts/08-10-31/telerik_reporting_-_tips_and_tricks.aspx?

Sincerely yours,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Darren
Top achievements
Rank 1
answered on 11 Nov 2009, 05:39 PM
Hi Steve,

I don't quite understand that code.  I did look at it before I posted.  I have multiple subreports and that code doesn't seem to fit.  I'm using  the_NeedDataSource event also.

How do I make the report in the subreport control invisible?

Thanks,
Darren
0
Steve
Telerik team
answered on 16 Nov 2009, 03:45 PM
Hi Darren,

In your first post you state: "I don't seem to be able to get to the inner report of my subreport controls" and I've pointed you to a post that shows how to get the report:

private void subReport1_NeedDataSource(object sender, System.EventArgs e)
{
Telerik.Reporting.Processing.SubReport subReport = (Telerik.Reporting.Processing.SubReport)sender;
Telerik.Reporting.Processing.Report report = (Telerik.Reporting.Processing.Report)subReport.InnerReport;
report.Visible = ...



Greetings,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Darren
Top achievements
Rank 1
answered on 16 Nov 2009, 03:56 PM
Hi Steve,

I have multiple subreports.  How do I address them individually?

Thanks,
Darren
Tags
General Discussions
Asked by
Darren
Top achievements
Rank 1
Answers by
Steve
Telerik team
Darren
Top achievements
Rank 1
Share this question
or