0

I have created a child report which loads data if a parameter is passed from Parent Report. It works fine except for the IMAGE. Image doesn't load. It fails by throwing error:

An attempt was made to set a report parameter 'SubImgPath' that is not defined in this report.

I have defined a parameter 'SubImgPath' inside Child Report and sending parameter but fails:

    ReportViewer1.LocalReport.EnableExternalImages = true;
    string FilePath = new Uri(Server.MapPath("~/SiteImages/")).AbsoluteUri;
    ReportParameter param = new ReportParameter("SubImgPath", FilePath);
    ReportViewer1.LocalReport.SetParameters(param);
    ReportViewer1.LocalReport.Refresh();
Dale K
  • 25,246
  • 15
  • 42
  • 71
Juventus tech
  • 95
  • 4
  • 13

1 Answers1

0

You need to define the parameter in your report.

In the designer you can use this command: CTRL+ALT+D to open the Report Data panel, or you can access it by the menu: View > Report Data

Here you can define the parameters for your report.

Here is in short how to pass down a report parameter:

  • Goto SubReport > Report Data Pane > Parameters and add the parameter you want to receive.

  • Goto MainReport > Right-click SubReport > Subreport Properties > Parameters and add the same parameter name and pick the relevant
    value from the dropdown.

Community
  • 1
  • 1
Oceans
  • 3,445
  • 2
  • 17
  • 38