Accessing a subreport's public method

2 posts, 0 answers
  1. Hugo Aristizabal
    Hugo Aristizabal avatar
    22 posts
    Member since:
    Jan 2010

    Posted 04 May 2010 Link to this post

    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.
  2. Hugo Aristizabal
    Hugo Aristizabal avatar
    22 posts
    Member since:
    Jan 2010

    Posted 04 May 2010 Link to this post

    Hi, i finally got it. Inside r1's constructor:

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

  3. DevCraft banner
Back to Top