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 <> '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...
<ReportParametersLayout><CellDefinitions>
node to include a <CellDefinition>
node for each parameter (code below)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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With