Passing Parameters to Subreport

Parameters property of the SubReport can be used to pass parameters from master report to subreport. Collection Editor is editor of this property.

Expression property sets expression which calculation result will be passed as a parameter. Name property sets name used to refer to parameter value in subreport.

To get parameter value in subreport GetParameter(" ") expression is used.

Sample of a template displaying employees list. Names and sequence numbers are displayed in subreport

Master Report Template:

Property subReport1.TemplateName = Report1

Two parameters are added to the subReport1.Parameters collection. First parameter: Expression = dataBand1.LineNumber, Name = Number. Second parameter: Expression = dataBand1["EmployeeName"]. Name = Name.

Subreport Template:

textBox1.Value = GetParameter("Number");

textBox2.Value = GetParameter("Name")

Report:

Add Feedback