简体   繁体   中英

SSRS file error message: The number of defined parameters is not equal to the number of cell definitions in the parameter panel

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:

“The number of defined parameters is not equal to the number of cell definitions in the parameter panel”

在此处输入图片说明

I did also try running this in Report Builder and I received the same error message.

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.

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-- SSRS the definition of the report is invalid ; 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).

Any help is appreciated.

Lines 16..20

    <QueryParameters>
      <QueryParameter Name=":PmPROD_WHSEPROD_CODE">
        <Value>=Parameters!PmPROD_WHSEPROD_CODE.Value</Value>
      </QueryParameter>
    </QueryParameters>

Lines 1533..1573

  <ReportParameters>
    <ReportParameter Name="PmPROD_WHSEPROD_CODE">
      <DataType>String</DataType>
      <Prompt>Pm-PROD_WHSE.PROD_CODE</Prompt>
    </ReportParameter>
    <ReportParameter Name="g_invtot">
      <DataType>Float</DataType>
      <Prompt>invtot</Prompt>
      <Hidden>true</Hidden>
    </ReportParameter>
    <ReportParameter Name="g_grdtotinv">
      <DataType>Float</DataType>
      <Prompt>grdtotinv</Prompt>
      <Hidden>true</Hidden>
    </ReportParameter>
    <ReportParameter Name="g_totweight">
      <DataType>Float</DataType>
      <Prompt>totweight</Prompt>
      <Hidden>true</Hidden>
    </ReportParameter>
    <ReportParameter Name="g_grand_tot_wgt">
      <DataType>Float</DataType>
      <Prompt>grand_tot_wgt</Prompt>
      <Hidden>true</Hidden>
    </ReportParameter>
    <ReportParameter Name="g_grdtotwgt">
      <DataType>Float</DataType>
      <Prompt>grdtotwgt</Prompt>
      <Hidden>true</Hidden>
    </ReportParameter>
    <ReportParameter Name="g_totinv">
      <DataType>Float</DataType>
      <Prompt>totinv</Prompt>
      <Hidden>true</Hidden>
    </ReportParameter>
    <ReportParameter Name="g_totqtyonorder">
      <DataType>Float</DataType>
      <Prompt>totqtyonorder</Prompt>
      <Hidden>true</Hidden>
    </ReportParameter>
  </ReportParameters>

Lines 1574..1586

  <ReportParametersLayout>
    <GridLayoutDefinition>
      <NumberOfColumns>4</NumberOfColumns>
      <NumberOfRows>2</NumberOfRows>
      <CellDefinitions>
        <CellDefinition>
          <ColumnIndex>0</ColumnIndex>
          <RowIndex>0</RowIndex>
          <ParameterName>PmPROD_WHSEPROD_CODE</ParameterName>
        </CellDefinition>
      </CellDefinitions>
    </GridLayoutDefinition>
  </ReportParametersLayout>

Lines 21..55

<CommandText>
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 &lt;&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</CommandText>

So it turns out that even if the parameter is hidden, it still need to have have a tag in the RDL file. I figured this out by testing another report to see how the RDL file behaved with a hidden parameter.

To correct the problem RDL file...

  1. I opened it in a text editor
  2. updated the <ReportParametersLayout><CellDefinitions> node to include a <CellDefinition> node for each parameter (code below)
  3. saved the file
  4. reopened the file in Visual Studio SSDT project, and then it worked! The report preview completed just fine.

Hope this helps someone else.

  <ReportParametersLayout>
    <GridLayoutDefinition>
      <NumberOfColumns>4</NumberOfColumns>
      <NumberOfRows>2</NumberOfRows>
      <CellDefinitions>
        <CellDefinition>
          <ColumnIndex>0</ColumnIndex>
          <RowIndex>0</RowIndex>
          <ParameterName>PmPROD_WHSEPROD_CODE</ParameterName>
        </CellDefinition>
        <CellDefinition>
          <ColumnIndex>1</ColumnIndex>
          <RowIndex>0</RowIndex>
          <ParameterName>g_invtot</ParameterName>
        </CellDefinition>
        <CellDefinition>
          <ColumnIndex>2</ColumnIndex>
          <RowIndex>0</RowIndex>
          <ParameterName>g_grdtotinv</ParameterName>
        </CellDefinition>
        <CellDefinition>
          <ColumnIndex>3</ColumnIndex>
          <RowIndex>0</RowIndex>
          <ParameterName>g_totweight</ParameterName>
        </CellDefinition>
        <CellDefinition>
          <ColumnIndex>0</ColumnIndex>
          <RowIndex>1</RowIndex>
          <ParameterName>g_grand_tot_wgt</ParameterName>
        </CellDefinition>
        <CellDefinition>
          <ColumnIndex>1</ColumnIndex>
          <RowIndex>1</RowIndex>
          <ParameterName>g_grdtotwgt</ParameterName>
        </CellDefinition>
        <CellDefinition>
          <ColumnIndex>2</ColumnIndex>
          <RowIndex>1</RowIndex>
          <ParameterName>g_totinv</ParameterName>
        </CellDefinition>
        <CellDefinition>
          <ColumnIndex>3</ColumnIndex>
          <RowIndex>1</RowIndex>
          <ParameterName>g_totqtyonorder</ParameterName>
        </CellDefinition>
      </CellDefinitions>
    </GridLayoutDefinition>
  </ReportParametersLayout>

您还可以从报告 xml 文件中删除“ReportParametersLayout”标签

Design - NewDesign, Copy all objects in OldDesign and paste in NewDesign, Delete OldDesign and Publish. This is my solution too, it works fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM