Solved

Incremental Counter - Odd and Even

Posted on 2015-01-27
2
120 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

Question has a verified solution.

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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
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…

840 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