Solved

Incremental Counter - Odd and Even

Posted on 2015-01-27
2
126 Views
Last Modified: 2015-01-27
Good morning,

I have a report with 4 groups, two are suppressed and the other two are visible.  Of these two groups, Let's Call them A and B - I want to see if I can do the following:

Group A - The user will enter an odd number, say 5 and then the records in group A will increase in odd values from 5; 5, 7, 9, 11 etc.

Group B - The user will enter an even number, say 6 and then the records in group B will increase in even values from 6; 6, 8, 10, 12 etc.

Does anyone have any ideas on how to do this?

Thank you in advance,
CS
0
Comment
Question by:rporter45
2 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 40572743
Are you trying to simply number the records in the group or is there some kind of selection process going on?

You mention 4 groups as if they are different things.  Do you mean you are grouping by say STATE for addresses  and you want California and New York numbered and you have Texas and Florida suppressed? or do you have multiple groupings like State then City?

In the former you could create 2 formulas  to do the counting using variables
In the report header add a formula
WhilePrintingRecords;
Global NumberVar OddCount := {?YourParam}) - 2;
Global NumberVar EvenCount := {?YourParam} - 1;
""

Open in new window

To display the counts
WhilePrintingRecords;
Global NumberVar OddCount ;
OddCount := OddCount + 2;
OddCOunt

Open in new window


Similarly for EvenCount
WhilePrintingRecords;
Global NumberVar EvenCount ;
EvenCount := EvenCount + 2;
EvenCount 

Open in new window


mlmcc
0
 

Author Closing Comment

by:rporter45
ID: 40573061
This is fantastic - works perfectly thank you!

CS
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Crystal Reports get subgroup count 1 60
Crystal image Object type? 7 46
A string is required here error 20 26
How to select one number or leave at all for a parameter? 4 19
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question