Is there a way to number/alphabetize subsections automatically without building an array? We have an array built into a report, but it needs to be updated as the number of items continues to grow.
This report probably has about 75 major subsections just for starters. Setting that aside:
This issue occurs within a subreport that is embedded within one "sub-detail" section of the main report (meaning "Detail 'ah'", or "Detail "ai", or "Detail "aj", for example), so, concentrating on this one subreport ...
Within the subreport, I simply have "Details a" and Details b" for the main subsections.
Inside "Details a", I have two formulae and one field that mirror data results if they exist.
One of the formulae builds an array, so in other words, depending on the number of results provided at run-time, each result will be preceded by the relevant array result. The result on the report would look like:
ah. Attend meeting in Louisiana. Joe Jamison
ai. Attend conference in St. Thomas. Simon Strong
aj. Meeting with team at headquarters. Frank Fellows
Now, this is all fine until the report runs, let's say, 573 results, each of which will need an array result. Well, of course I can keep adding to the array, but from an intelligent perspective, I imagine there must be some sort of automated way to create the same kind of results that the array is creating, without having to manually update a formula.
Here is a formula to automatically letter up to 17,602 rows from a. to zzz. If you wanted to reset this within groups, then you could use another variable y instead of recordnumber and add a reset formula in the group header.
whileprintingrecords;
stringVar array Letter := ["a","b","c","d","e","f",
"g","h","i","j","k","l","m","n","o","p","q","r",
"s","t","u","v","w","x","y","z"];
stringvar x;
numbervar j;
numbervar k;
numbervar m;
if recordnumber <= 26 then
(j := j + 1;
x := Letter[j] + ". ") else
if recordnumber in 27 to 702 then
(if remainder(recordnumber,26) = 1 then
k := k + 1;
if j = 26 then
j := 1 else
j := j + 1;
x := Letter[k] + Letter[j]+". ") else
if recordnumber in 703 to 17602 then
(if remainder(recordnumber,676) = 27 then
m := m + 1;
if k = 26 then
k := 1 else
if remainder(recordnumber,26) = 1 then
k := k + 1;
if j = 26 then
j := 1 else
j := j + 1;
x := Letter[m] + Letter[k] + Letter[j]+". ");
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.