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

Master & Subreport constructors

2 Answers 22 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Patrick
Top achievements
Rank 1
Patrick asked on 29 Jul 2010, 08:45 PM
I have a master report, the ctor of which accepts 4-arguments. This report contains 1-subreport. In the InitializeComponents() method of the master report, an instance of the sub-report is created, which fires the ctor of the sub-report. My problem is that I need to pass along some of the arguments sent to the master report ctor to the sub-report ctor. Ideas anyone? A sample of how to accomplish this would be most useful.

Thanks!

2 Answers, 1 is accepted

Sort by
0
Massimiliano Bassili
Top achievements
Rank 1
answered on 30 Jul 2010, 12:16 PM
It seems to me that you should be able to achieve that using report parameters i.e. create report parameters for the subreport that match the number of arguments you want to pass. Then in the master constructor set their value to the arguments of the master report constructor.
If this does not work for you, it would be great to explain more about what you're trying to achieve.

Cheers
0
Patrick
Top achievements
Rank 1
answered on 30 Jul 2010, 02:58 PM
Under normal circumstances that works. I've come up w/ a work-around, but it's butt-ugly :(
Tags
General Discussions
Asked by
Patrick
Top achievements
Rank 1
Answers by
Massimiliano Bassili
Top achievements
Rank 1
Patrick
Top achievements
Rank 1
Share this question
or