ASKER
ASKER
ASKER
ASKER
Crystal Reports is a business intelligence application from SAP SE. It is used to graphically design data connections and report layouts from a wide range of data sources including Excel spreadsheets, Oracle, SQL Server databases and Access databases, BusinessObjects Enterprise business views, and local file-system information. Report designers can place fields from these sources on the report design surface, and can also deploy them in custom formulas (using either BASIC or Crystal's own syntax), which are then placed on the design surface. Crystal Reports also supports subreports, graphing, and a limited amount of GIS functionality.
TRUSTED BY
ASKER
James helped with this
In the 1st sub report there is:
WhilePrintingRecords;
Shared NumberVar MyValue2;
Shared StringVar Array loc_names;
Shared NumberVar Array loc_totals;
Shared NumberVar loc_count;
Local NumberVar i;
MyValue2 := Sum ({@NoDoneInPeriod}, {WOEQLIST.LOCATION});
if loc_count > 0 and {WOEQLIST.LOCATION} in loc_names then
(
// If LOCATION is in the loc_names array, find which entry it's in
// and then add the Sum to the corresponding entry in loc_totals
for i := 1 to loc_count do
if loc_names [ i ] = {WOEQLIST.LOCATION} then
exit for;
loc_totals [ i ] := loc_totals [ i ] + Sum ({@NoDoneInPeriod}, {WOEQLIST.LOCATION});
)
else
(
// If LOCATION is not in the loc_names array, increment the count,
// resize (Redim) the array to match (Preserve keeps the existing
// array contents), and put LOCATION and the Sum in the last entries
loc_count := loc_count + 1;
Redim Preserve loc_names [ loc_count ];
Redim Preserve loc_totals [ loc_count ];
loc_names [ loc_count ] := {WOEQLIST.LOCATION};
loc_totals [ loc_count ] := Sum ({@NoDoneInPeriod}, {WOEQLIST.LOCATION});
);
In the second report can only see
WhilePrintingRecords;
Shared NumberVar MyValue2;
Shared StringVar Array loc_names;
Shared NumberVar Array loc_totals;
Shared NumberVar loc_count;
Local NumberVar i;
if {WOEQLIST.LOCATION} in loc_names then
(
// If LOCATION is in the loc_names array, find which entry it's in
// and then output the corresponding entry from loc_totals
for i := 1 to loc_count do
if loc_names [ i ] = {WOEQLIST.LOCATION} then
exit for;
loc_totals [ i ]
)
else
// If LOCATION is not in the loc_names array, just output 0
0
Does this make sense or is something missing
Gordon