none
LocalReport SetParameters "One of more parameters were not specified for the subreport" RRS feed

  • Question

  • Hi,

    I am having trouble after updating my Microsoft.ReportViewer.WinForms.dll  (the report did work correctly with v10, but now I have updated it to v11).  

    I believe I am using the SetParameters() function correctly but I get the error "One of more parameters were not specified for the subreport. 'subreportheader'. located at: Header."

    Edit:  I added default parameters to the report parameters and they are shown.  So, it seems like something isn't working correctly with the report parameters being set.

    Here is where I am attempting to set my report parameters:

    List<ReportParameter> parameters = new List<ReportParameter>();
    
    parameters.Add(new ReportParameter("Title","MyTitle"));
    parameters.Add(new ReportParameter("Description","MyDescription"));
    
    this.reportViewer.LocalReport.SetParameters(parameters);
    
    this.reportViewer.LocalReport.ExecuteReportInSandboxAppDomain();
    this.reportViewer.LocalReport.Refresh();
    this.reportViewer.RefreshReport();

    Here is the report parameters section of my rdlc: 

    <ReportParameters>
        <ReportParameter Name="Title">
          <DataType>String</DataType>
          <Nullable>true</Nullable>
          <DefaultValue>
            <Values>
              <Value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" />
            </Values>
          </DefaultValue>
          <AllowBlank>true</AllowBlank>
          <Prompt>Title</Prompt>
        </ReportParameter>
        <ReportParameter Name="Description">
          <DataType>String</DataType>
          <Nullable>true</Nullable>
          <DefaultValue>
            <Values>
              <Value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" />
            </Values>
          </DefaultValue>
          <AllowBlank>true</AllowBlank>
          <Prompt>Description</Prompt>
        </ReportParameter>
    </ReportParameters>

    And here is my subreportHeader section of the rdlc:

    <Subreport Name="subreportHeader">
                              <ReportName>Header</ReportName>
                              <Parameters>
                                <Parameter Name="Title">
                                  <Value>=Parameters!Title.Value</Value>
                                </Parameter>
                                <Parameter Name="Description">
                                  <Value>=Parameters!Description.Value</Value>
                                </Parameter>
                              </Parameters>
                              <KeepTogether>true</KeepTogether>
                              <Height>0.125in</Height>
                              <Width>8.875in</Width>
                              <Style>
                                <Border />
                              </Style>
                            </Subreport>

    What do I need to do to fix this report?

    Thanks.



    • Edited by ajb32x Thursday, August 15, 2013 1:18 PM
    Wednesday, August 14, 2013 4:19 PM

All replies

  • I would like to note I never figured out why the parameters stopped working.  I solved this problem by using a new datasource instead of parameters though.
    Tuesday, August 27, 2013 3:03 PM