简体   繁体   English

SSRS文件错误信息:参数面板中定义的参数数量不等于单元格定义数量

[英]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.我已使用自动化服务工具将报告文件从 Crystal (.rpt) 转换为 SSRS (.rdl)。 When I preview the report in Viusal Studio SSDT I am getting a very strange error message:当我在 Viusal Studio SSDT 中预览报告时,我收到一条非常奇怪的错误消息:

“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.我也尝试在 Report Builder 中运行它,但收到了相同的错误消息。

The RDL file has 1710 lines; RDL 文件有 1710 行; Below is the code for some of the nodes of the that seem like they would be relevant-- ReportParameters, ReportLayout, QueryParameters, CommandText.下面是一些看起来相关的节点的代码 - 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 ;我看过一篇文章,建议隐藏参数必须有一个默认值——SSRS 报告的定义无效 Of the 8 parameters 7 are hidden and none of them have default parameters. 8 个参数中有 7 个是隐藏的,没有一个有默认参数。 But I'm not sure what the default values should be (if there must be one).但我不确定默认值应该是什么(如果必须有的话)。

Any help is appreciated.任何帮助表示赞赏。

Lines 16..20第 16..20 行

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

Lines 1533..1573第 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第 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第 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.所以事实证明,即使参数被隐藏,它仍然需要在 RDL 文件中有一个标签。 I figured this out by testing another report to see how the RDL file behaved with a hidden parameter.我通过测试另一份报告以查看 RDL 文件如何处理隐藏参数来解决这个问题。

To correct the problem RDL file...要更正问题 RDL 文件...

  1. I opened it in a text editor我在文本编辑器中打开它
  2. updated the <ReportParametersLayout><CellDefinitions> node to include a <CellDefinition> node for each parameter (code below)更新了<ReportParametersLayout><CellDefinitions>节点,为每个参数包含一个<CellDefinition>节点(下面的代码)
  3. saved the file保存了文件
  4. reopened the file in Visual Studio SSDT project, and then it worked!在 Visual Studio SSDT 项目中重新打开该文件,然后它就起作用了! 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. Design - NewDesign,复制 OldDesign 中的所有对象并粘贴到 NewDesign 中,删除 OldDesign 并发布。 This is my solution too, it works fine.这也是我的解决方案,它工作正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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