*************
Map Call
Area Count
11 10
22 11
33 20
44 15
etc
****************
Ok...these are results displayed in the group footer section for the group Map Area.
I use a different approach to lbass...basically because it is the way I have always done it...I don't use running totals very much prefering to do my totaling manually...but his method probably has merit too....there are many ways to acomplish the same effect in CR.
This is my way.
If there is no group before Map Area I would put the following initializing formula in the Report Header
@Initialize (suppressed in report header)
WhilePrintingRecords;
//estimate the number of Map Areas then add 50% for later
//report expansion. Eg. if there are currently 50 map areas
//initialize 75...use the same number for Calls
StringVar array MapArea := ["","","",......"","",""];
StringVar array Calls := ["","","",......"","",""];
NumberVar pointer := 0;
If this is in a Group Header before the Group Map Area then modify the formula slightly
WhilePrintingRecords;
//estimate the number of Map Areas then add 50% for later
//report expansion. Eg. if there are currently 50 map areas
//initialize 75...use the same number for Calls
If not inrepeatedGroupHeader then
(
StringVar array MapArea := ["","","",......"","",""];
StringVar array Calls := ["","","",......"","",""];
NumberVar pointer := 0;
);
Now in the Group footer were you are currently Displaying the Map Areas/Calls replace these fields with the following field and suppress the Group footer totally
@CollectSums
WhilePrintingRecords;
StringVar array MapArea ;
StringVar array Calls ;
NumberVar pointer ;
//if Map Area is a number convert it to a string as well
//convert Calls to a string
pointer := pointer + 1;
//you want a maintenance alert if you exceed your estimated
//number of entries...perhaps this can be done dynamically
//with a redim though I have never done it myself
If pointer >= ubound(MapArea) then
(
//this will give us a clue as to how much data we lost
MapArea[ubound(MapArea)] := "Missing";
Calls[ubound(MapArea)] := "Data =" + totext(pointer,0);
)
else
(
MapArea[pointer] := {table.MapArea} //convert to string
//if necessary
Calls[pointer] := totext(sum of calls,0);
);
Now in the Group footer of the group before Map Area or in the report footer if there is no Group you place the results
For Balance determine how many columns you want. You are limited to 254 chars/string but map areas seem to be only 2 or 3 chars so that is no limitation really...there amy be say 1000 calls so that is no problem also...
The number of columns is really determined by how many areas are displayed...
For example: Let us say we had 50 areas/calls...within the 254 char limit we could display all values in one "can Grow" string formula for Map Area and Calls respectively but that would not be what we want... A better look would be 5 columns of 10 rows each
So we would create 5 display formulas for Map Area and 5 for Calls
@Display_MapArea_1
WhilePrintingRecords;
StringVar array MapArea ;
StringVar result1 := "";
if MapArea[1] <> "" then
result1 := "Map Area" + Chr(13) + Chr(10) +
" " + MapArea[1]+ Chr(13) + Chr(10) +
" " + MapArea[2]+ Chr(13) + Chr(10) +
" " + MapArea[3]+ Chr(13) + Chr(10) +
" " + MapArea[4]+ Chr(13) + Chr(10) +
" " + MapArea[5]+ Chr(13) + Chr(10) +
" " + MapArea[6]+ Chr(13) + Chr(10) +
" " + MapArea[7]+ Chr(13) + Chr(10) +
" " + MapArea[8]+ Chr(13) + Chr(10) +
" " + MapArea[9]+ Chr(13) + Chr(10) +
" " + MapArea[10] ;
result1;
Similarly for Calls you would do
@Display_Calls_1
WhilePrintingRecords;
StringVar array Calls;
StringVar result2 := "";
//this if checks for data if there is none then the
//formula will be null and nothing seen
if Calls[1] <> "" then
result2 := "Calls" + Chr(13) + Chr(10) +
" " + Calls[1]+ Chr(13) + Chr(10) +
" " + Calls[2]+ Chr(13) + Chr(10) +
" " + Calls[3]+ Chr(13) + Chr(10) +
" " + Calls[4]+ Chr(13) + Chr(10) +
" " + Calls[5]+ Chr(13) + Chr(10) +
" " + Calls[6]+ Chr(13) + Chr(10) +
" " + Calls[7]+ Chr(13) + Chr(10) +
" " + Calls[8]+ Chr(13) + Chr(10) +
" " + Calls[9]+ Chr(13) + Chr(10) +
" " + Calls[10] ;
result2;
The reason for 2 formulas is so that they will have a razor sharp edge when printed side-by-side
In a similar manner create 4 more sets of formulas for 11-20, 21-30, 31-40 and 41-50
Arrange them in the footer (report or otherwise) and there you have it....make sure the "can Grow" is turned on for each formula
Hope this helps.
Jim Broadbent