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

Accessing a subreport's public method

1 Answer 48 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Hugo Aristizabal
Top achievements
Rank 2
Hugo Aristizabal asked on 04 May 2010, 03:02 PM
Hi. I have two reports, r1 and r2. r2 is a subreport of r1, and it has a method called m1, which is public. In r1, the subreport's name (which, as I said, references r2) is sb1. How can I access the m1 method through sb1?

To make myself more clear, basically what the m1 method does is to set r2's DataSource, and I need to do it from the parent report, which is r1. Am I trying to do it in the right way? What do you recommend?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Hugo Aristizabal
Top achievements
Rank 2
answered on 04 May 2010, 03:12 PM
Hi, i finally got it. Inside r1's constructor:

((r2)sr1.ReportSource).m1(); 

Tags
General Discussions
Asked by
Hugo Aristizabal
Top achievements
Rank 2
Answers by
Hugo Aristizabal
Top achievements
Rank 2
Share this question
or