Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 588
  • Last Modified:

How to show record count in report header?


I need to show the total number of records on the report header.  I tried

WhilePrintingRecords;
NumberVar RunningCount;
NumberCount

but it always returns 1.

How do I do this?

Thanks
0
janmarini
Asked:
janmarini
  • 2
  • 2
  • 2
1 Solution
 
frodomanCommented:
Just insert a grand total on one of your columns, but set it to "count" instead of "sum".  Then move the grand total from the report footer to the report header.
0
 
frodomanCommented:
If you need instructions:

Click on a field in the detail section to select it.

Click Insert -> Grand Total.

Default in dropdown will be "SUM" - change this by selecting "COUNT"

The count field will be placed in the RF by default but you can drag & drop it on the RH.
0
 
_TAD_Commented:


The best solution (in my opinion) is provided above by frodoman.


However, there are some instances when you want to put conditions on your count, but you don't necessarily want group by that condition.

The way around this is to create three formulas

formula1  init_count:  // gets placed on the level you want to reset your count to 0
WhilePrintingRecords;
Shared NumberVar count := 0;
count;

formula2 inc_count: // gets placed usually in the details section, but not always
WhilePrintingRecords;
Shared NumberVar count;
If (<condition>) then
     count := count + 1
else
     count;

count;


formula3 disp_count: // place wherever you want to see the final value
WhilePrintingRecords;
Shared NumberVar count;
count;

0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
janmariniAuthor Commented:
ummm... Kind of new here and I am not sure how to split points.  Both of your answers are great, and helped me out a lot.  I wasn't able to move the Grand Total Field - but after I placed and suppressed the GT, I was able to reference it in a formula that I placed in the Report Header, and that worked perfectly.  And I appreciate the added info from Tad, will be usefull in the future - I'm sure.  LOL - been working with Crystal forever, and there is always so much to learn!  Since I don't have a lot of experience with this forum, please help me figure out how I can divvy up the points appropriately.

Thank you!
0
 
_TAD_Commented:



Give Frodoman the points.



I didn't submit a comment for points... it was more of an FYI (just in case).

Frodoman provided the answer to the question you asked.  I believe awarding him full points would be the most fair route to go.
0
 
janmariniAuthor Commented:
Thank you!
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now