首页 文章

Crystal Reports按日期动态分组

提问于
浏览
1

我对Crystal Reports相对较新,看起来这应该很容易,但是经过大量的谷歌搜索后我无法弄明白 . 我正在处理Crystal Reports XI中的报告,该报告将显示支持人员记录日期范围的总小时数,并根据用户输入显示按周,月或两者显示的小计 . 我的报告目前安排如下:

Group 1 Header - Support Staff Member 
  Group 2 Header - Ticket Closed Date with section printed monthly
    Group 3 Header - Ticket Closed Date with section printed weekly
      Group 4 Header - Ticket Category
      Group 4 Footer - Sum of time logged in each category for the week
    Group 3 Footer - Sum of time logged in all categories for the week   
  Group 2 Footer - Sum of time logged in all categories for the month
Group 1 Footer - Sum of all time logged

我最初的想法只是在不需要时抑制第2组和第3组的页眉和页脚,但如果我手动执行此操作,它仍会按周和月打印记录 . 除非参数显示这些总数,否则有没有办法不进行分组?或者,如果这不是一个选项,我将如何使用该参数来更改该组是每周还是每月打印记录?

谢谢

1 回答

  • 1

    最佳选择是创建一个字符串参数'option',其值为每周和每月 .

    现在创建一个公式分组 .

    If ?parameter='weekly'
    Then //your weekly code here
    
    Else if ?parameter='monthly'
    Then //your monthly code
    

    现在在分组中使用此公式而不是多个组 .

    现在,当用户选择选项时,您的分组将动态更改 .

    希望这可以帮助

相关问题