title: SSRS file error message: The number of defined parameters is not equal to the number of cell definitions in the parameter panel
body: <p>I have converted a report file from Crystal (.rpt) to SSRS (.rdl) using an automated service tool.  When I preview the report in Viusal Studio SSDT I am getting a very strange error message:</p>
  
  <p><strong>“The number of defined parameters is not equal to the number of cell definitions in the parameter panel”</strong></p>
  
  <p><a href="https://i.stack.imgur.com/6MEfc.png" rel="noreferrer"><img src="https://i.stack.imgur.com/6MEfc.png" alt="enter image description here"></a></p>
  
  <p>I did also try running this in Report Builder and I received the same error message.</p>
  
  <p>The RDL file has 1710 lines; Below is the code for some of the nodes of the that seem like they would be relevant-- ReportParameters, ReportLayout, QueryParameters, CommandText.</p>
  
  <p>Does anyone know what could be causing this error?  And how I can get resolve it?  I have read one article that suggested hidden parameters must have a default value-- <a href="https://stackoverflow.com/questions/6060128/ssrs-the-definition-of-the-report-is-invalid">SSRS the definition of the report is invalid</a>;  Of the 8 parameters 7 are hidden and none of them have default parameters.  But I'm not sure what the default values should be (if there must be one).  </p>
  
  <p>Any help is appreciated.</p>
  
  <p>Lines 16..20</p>
  
  <pre><code>    &lt;QueryParameters&gt;
        &lt;QueryParameter Name=":PmPROD_WHSEPROD_CODE"&gt;
          &lt;Value&gt;=Parameters!PmPROD_WHSEPROD_CODE.Value&lt;/Value&gt;
        &lt;/QueryParameter&gt;
      &lt;/QueryParameters&gt;
  </code></pre>
  
  <p>Lines 1533..1573</p>
  
  <pre><code>  &lt;ReportParameters&gt;
      &lt;ReportParameter Name="PmPROD_WHSEPROD_CODE"&gt;
        &lt;DataType&gt;String&lt;/DataType&gt;
        &lt;Prompt&gt;Pm-PROD_WHSE.PROD_CODE&lt;/Prompt&gt;
      &lt;/ReportParameter&gt;
      &lt;ReportParameter Name="g_invtot"&gt;
        &lt;DataType&gt;Float&lt;/DataType&gt;
        &lt;Prompt&gt;invtot&lt;/Prompt&gt;
        &lt;Hidden&gt;true&lt;/Hidden&gt;
      &lt;/ReportParameter&gt;
      &lt;ReportParameter Name="g_grdtotinv"&gt;
        &lt;DataType&gt;Float&lt;/DataType&gt;
        &lt;Prompt&gt;grdtotinv&lt;/Prompt&gt;
        &lt;Hidden&gt;true&lt;/Hidden&gt;
      &lt;/ReportParameter&gt;
      &lt;ReportParameter Name="g_totweight"&gt;
        &lt;DataType&gt;Float&lt;/DataType&gt;
        &lt;Prompt&gt;totweight&lt;/Prompt&gt;
        &lt;Hidden&gt;true&lt;/Hidden&gt;
      &lt;/ReportParameter&gt;
      &lt;ReportParameter Name="g_grand_tot_wgt"&gt;
        &lt;DataType&gt;Float&lt;/DataType&gt;
        &lt;Prompt&gt;grand_tot_wgt&lt;/Prompt&gt;
        &lt;Hidden&gt;true&lt;/Hidden&gt;
      &lt;/ReportParameter&gt;
      &lt;ReportParameter Name="g_grdtotwgt"&gt;
        &lt;DataType&gt;Float&lt;/DataType&gt;
        &lt;Prompt&gt;grdtotwgt&lt;/Prompt&gt;
        &lt;Hidden&gt;true&lt;/Hidden&gt;
      &lt;/ReportParameter&gt;
      &lt;ReportParameter Name="g_totinv"&gt;
        &lt;DataType&gt;Float&lt;/DataType&gt;
        &lt;Prompt&gt;totinv&lt;/Prompt&gt;
        &lt;Hidden&gt;true&lt;/Hidden&gt;
      &lt;/ReportParameter&gt;
      &lt;ReportParameter Name="g_totqtyonorder"&gt;
        &lt;DataType&gt;Float&lt;/DataType&gt;
        &lt;Prompt&gt;totqtyonorder&lt;/Prompt&gt;
        &lt;Hidden&gt;true&lt;/Hidden&gt;
      &lt;/ReportParameter&gt;
    &lt;/ReportParameters&gt;
  </code></pre>
  
  <p>Lines 1574..1586</p>
  
  <pre><code>  &lt;ReportParametersLayout&gt;
      &lt;GridLayoutDefinition&gt;
        &lt;NumberOfColumns&gt;4&lt;/NumberOfColumns&gt;
        &lt;NumberOfRows&gt;2&lt;/NumberOfRows&gt;
        &lt;CellDefinitions&gt;
          &lt;CellDefinition&gt;
            &lt;ColumnIndex&gt;0&lt;/ColumnIndex&gt;
            &lt;RowIndex&gt;0&lt;/RowIndex&gt;
            &lt;ParameterName&gt;PmPROD_WHSEPROD_CODE&lt;/ParameterName&gt;
          &lt;/CellDefinition&gt;
        &lt;/CellDefinitions&gt;
      &lt;/GridLayoutDefinition&gt;
    &lt;/ReportParametersLayout&gt;
  </code></pre>
  
  <p>Lines 21..55</p>
  
  <pre><code>&lt;CommandText&gt;
  Select ORD_HDR.ORDER_SEQ_CODE ORD_HDR_ORDER_SEQ_CODE
      , ORD_HDR.MASTER_ORDER_NBR
      , ORD_HDR.STATUS_CODE
      , ORD_HDR.ORDER_TYPE
      , ORD_HDR.BILL_PO_ID
      , ORD_HDR.SHIP_PO_ID
      , ORD_HDR.SHIP_DATE
      , ORD_HDR.DELIVERY_DATE
      , ORD_HDR.SHIP_FROM_WHSE ORD_HDR_SHIP_FROM_WHSE
      , ORD_DTL.PROD_CODE ORD_DTL_PROD_CODE
      , ORD_DTL.CASES_ORD
      , PRODUCT.DESCR
      , Command.PRICE COMMAND_PRICE
      , Command.NAME COMMAND_NAME
      , Command.CITY COMMAND_CITY
      , Command.STATE_CODE COMMAND_STATE_CODE
   From (SELECT d.prod_code,
  d.order_seq_code,
  d.price + NVL (d.market_price_adj, 0) price,
  h.cust_shipto_code,
  c.name,
  c.city,
  c.state_code
  FROM ord_dtl d, ord_hdr h, customer_shipto c
  WHERE     d.order_seq_code = h.order_seq_code
  AND h.cust_code = c.cust_code
  AND h.cust_shipto_code = c.cust_shipto_code) Command
   INNER JOIN ROCCO.ORD_HDR ORD_HDR on (Command.ORDER_SEQ_CODE = ORD_HDR.ORDER_SEQ_CODE)
   INNER JOIN ROCCO.ORD_DTL ORD_DTL on (Command.PROD_CODE = ORD_DTL.PROD_CODE and ORD_DTL.ORDER_SEQ_CODE = ORD_HDR.ORDER_SEQ_CODE)
   INNER JOIN ROCCO.CUSTOMER CUSTOMER on (ORD_HDR.CUST_CODE = CUSTOMER.CUST_CODE)
   INNER JOIN ROCCO.PRODUCT PRODUCT on (ORD_DTL.PROD_CODE = PRODUCT.PROD_CODE)
   Where (((ORD_HDR.ORDER_TYPE &amp;lt;&amp;gt; 'tr') And (ORD_DTL.PROD_CODE = :PmPROD_WHSEPROD_CODE)) And (Not (ORD_HDR.STATUS_CODE in ('ED', 'dl', 'ip', 'sp')))) And (ORD_HDR.SHIP_FROM_WHSE = '06')
   Order by ORD_DTL.PROD_CODE
      , ORD_HDR.DELIVERY_DATE&lt;/CommandText&gt;
  </code></pre>