【问题标题】:Increment parameter field after 10 pages Crystal Reports10页水晶报表后递增参数字段
【发布时间】:2018-06-06 23:38:39
【问题描述】:

我是 Crystal Reports 的新手。我创建了一个参数字段名称 countParam 并将其添加到我的报告标题中。 countParam 是从我的 vb.net 代码初始化的。例如,我将其初始化为 50

现在,当我显示报告时,countParam 在报告标题中显示 50 值,并在所有页面中重复此值。

我想知道如何在 10 页之后将其增加到 51。例如,从第 1 页到第 10 页,countParam 显示为 50,从第 11 页到第 20 页显示为 51,然后从第 21 页到第 30 页显示为 52,依此类推...

我发现如果我添加 PageNumber 到它,它会成功地在每一页之后增加一,即 51,51,52。但是我不想要这个。我希望它 在 10 页之后。任何人都可以指导我如何完成我的任务。我会很感激的。

PS:我使用的是 Crystal Reports 2010

【问题讨论】:

    标签: vb.net visual-studio crystal-reports crystal-reports-2010


    【解决方案1】:

    您可以使用以下公式:

    {?countParam} + Int ((PageNumber / 10))
    

    【讨论】:

      【解决方案2】:

      我告诉你这个想法。

      创建一个局部变量并将标题放在要打印的位置。在变量字段中,添加每当页数乘以 10 时递增的公式,即

      //right now I do not know the syntax, please correct it
      numbervar iCount = 0 ;    // Initialization
      if ( iCount < countParam )   //this set 50
         {iCount := iCount + 1;}
      elseif ( (iCount > countParam) && ( countParam < @@PageNumber ) && ( @@PageNumber % 10 < iCount  - countParam) )   //this will increment if goes to beyond 
         {iCount := iCount + 1;}
      return iCount; 
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多