• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 214
  • Last Modified:

Crystal Reports

I am using Crystal Reports 7 and VB 6

I want to put a line number (in rows) on my report.  I can use the Record Number function but when my report involves GROUPING, using the record Number does not make sense since it will have a contineous line numbering.

I expect line numbers to start again from 1 when a new group of records is printed.  How to go about this?

0
rcbarot
Asked:
rcbarot
  • 5
  • 4
1 Solution
 
mdouganCommented:
I would do this by creating a couple of formula fields, one for doing the counting, one for doing the display, maybe even one to reset the counter.  Here is how it works, create a formula field and put it in the group header, and mark it surpressed so that it does not show, call it ClearCount, it will look like this:

@ClearCount
WhilePrintingRecords;
NumberVar GroupTotal;
GroupTotal = 0;

This formula is on the detail line, surpressed.  It keeps a running total for the group, and for the report:
@AddTotals
WhilePrintingRecords;
NumberVar GroupTotal;
NumberVar GrandTotal;
GroupTotal := GroupTotal + 1;
GrandTotal := GrandTotal + 1;

In the Group Footer, the following formula displays the subtotal (it is not surpressed):

@DisplayGroupTotal
WhilePrintingRecords;
NumberVar GroupTotal;
GroupTotal

In the Report Footer, the following formula displays the Grand Total (not surpressed):
@DisplayGrandTotal
WhilePrintingRecords;
NumberVar GrandTotal;
GrandTotal
0
 
rcbarotAuthor Commented:
Thanks a lot.  I tried your suggestion with minor modifications and it worked.

Thanks!
0
 
rcbarotAuthor Commented:
mdougan has given me his suggestion and it worked.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
rcbarotAuthor Commented:
This question has a deletion request Pending
0
 
rcbarotAuthor Commented:
As I have written above.
0
 
mdouganCommented:
This question no longer is pending deletion
0
 
mdouganCommented:
Hi, If my answer has solved your problem, then you need to Accept it, not delete it, otherwise your points wont be given.
0
 
rcbarotAuthor Commented:
Oh I am sorry.  I really don't understand how it works.  I thought comments are just comments.  Anyway, I am giving you the points.  Thanks again.
0
 
mdouganCommented:
Oh, no problem, thanks.  Yes, the etiquette here is that people should really just comment until you respond that a particular comment has solved your problem (or if a comment is leading you in the right direction, then you can post follow-up comments and have a dialog with the person or persons helping you).  Once you have a solution, you can accept one of the comments as an answer.  

If people are certain that they know the answer, then they might "answer" your question, but that has the effect of "locking" it, which moves it to an area where other experts might not bother to look at it, which means your question get less attention.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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