How to count number of grouped rows in the Crystal

2019-05-11 00:34发布

I need to count and show number of rows of grouped data in the report. I already have number of rows of total data in Report Footer section (I used Count() function and that works fine), but I need to have total rows in the Group Footer section which shows number of rows of grouped data. The visible explanation of the problem is shown under.

Thanks.

----------------------------------------------------
Group 1

        row 1---------------------------  
        row 2---------------------------
        .
        .
        .
        row N---------------------------
--- I need here number of rows!---------------------
----------------------------------------------------
Group 2

        row 1---------------------------  
        row 2---------------------------
        .
        .
        .
        row M---------------------------
--- I need here number of rows!---------------------
----------------------------------------------------
Total Rows: M+N

4条回答
我想做一个坏孩纸
2楼-- · 2019-05-11 01:17

This solved my problem Create new formula field

{IM_INV.QTY_ON_HND}-{IM_INV.QTY_ON_HND}+1

{Existing field} minus {exiting field} plus 1

This gave me a "1" next to each detail line in a field I called {NumberForCount}

Because it was made this way it showed up in running total field options

Then made a running total field like normal in the footer

查看更多
成全新的幸福
3楼-- · 2019-05-11 01:23

Try the solution

  1. Create a formula @reset. Place the formula in groupheader and supress

     Shared Numbervar count;
     count:=0
    
  2. Now create one more formula @ Increment and place in section where there are rows I have assumed it as detail section and supress.

    Shared Numbervar count;
    count:=count+1;
    count;
    
  3. Now create one more formula @Display. Place this formula in Group footer

    Shared Numbervar count;
    Shared Numbervar Count_Final;
    Count_Final:=Count_Final+count;
    count;
  4. Now create one more formula @DisplayFinal and place in Report Footer

    Shared Numbervar Count_Final;
    Count_Final
查看更多
\"骚年 ilove
4楼-- · 2019-05-11 01:34

Another way to try by using Summary

  1. Right Click > Insert > Summary

  2. Choose Field (I choose string value)

  3. Choose "Count" to Calculate This Summary Combo box

  4. Choose Summary Location in Where would you like to show this total

  5. Then OK

查看更多
萌系小妹纸
5楼-- · 2019-05-11 01:35

This solution may help someone,

Create a Running Total:

  1. Choose a field
  2. Select distinct count as Type of summary
  3. Choose your group name in Reset section
  4. Now drag and drop the running total field in group footer.

Refer the image below enter image description here

查看更多
登录 后发表回答