I've been trying to design a report with a subreport. I'm stuck on trying to get the subreport to update with a sql select using a parameter to the sqlselectcommand which calls a stored procedure. I've looked at the invoice demo and have tried to understand the process. I'm just not sure how the Report Parameters and the SqlSelectCommand parameters are able to communicate. If I try and code the parameter initialization in the constructor of the subreport the ReportParameter doesn't exist yet at this point and it errors out.
The main report works fine with the above parameter manipulation as shown below:
But inside the subreport you don't have the ability to hardcode the parameter so I'm not sure how to get the value to an identical type SelectCommand in the subreport. I've set a ReportParameter in the subreport called KeyPK, the main report then sets the subreport with KeyPK = =Parameters.[@KeyPK], I've put a break in the subreport after the InitializeComponent and the parameter is not set to the new value.
Hope I've explainded this sufficiently.
Thanks,
-Sid.
The main report works fine with the above parameter manipulation as shown below:
public RenewalList(int KeyPK) |
{ |
/// <summary> |
/// Required for telerik Reporting designer support |
/// </summary> |
InitializeComponent(); |
this.sqlDataAdapter1.SelectCommand.Parameters["@KeyPK"].Value = KeyPK; |
this.DataSource = this.sqlDataAdapter1; |
But inside the subreport you don't have the ability to hardcode the parameter so I'm not sure how to get the value to an identical type SelectCommand in the subreport. I've set a ReportParameter in the subreport called KeyPK, the main report then sets the subreport with KeyPK = =Parameters.[@KeyPK], I've put a break in the subreport after the InitializeComponent and the parameter is not set to the new value.
Hope I've explainded this sufficiently.
Thanks,
-Sid.