DO you only have 1 comment per store?
Can you using sample data show what it is you want?
mlmcc
WhilePrintingRecords;
Local NumberVar i;
Local NumberVar j;
Local NumberVar k;
Local NumberVar tmp_num;
Local NumberVar Array num_list;
Local StringVar tmp_str;
Local StringVar Array comments;
// Redim the arrays to hold the required number of values
Redim num_list [ 7 ];
Redim comments [ 7 ];
// Put the counts in the array
num_list := [ {@sum1}, {@sum2}, {@sum3}, {@sum4}, {@sum5}, {@sum6}, {@sum7} ];
// Put the comments in the array, in the same order as the counts above
comments := [ "Low Volume", "Soon to Open", "Sale Event", "System SKU Problem",
"Store bar code request", "Hold Store", "Manual generate OIS" ];
j := UBound (num_list);
// Sort the totals, from highest to lowest, and sort the comments along with them
if j > 1 then
for i := 1 to j - 1 do
for k := i + 1 to j do
if num_list [i] < num_list [k] then
(
tmp_num := num_list[i];
num_list[i] := num_list[k];
num_list[k] := tmp_num;
tmp_str := comments[i];
comments[i] := comments[k];
comments[k] := tmp_str
);
// Output the first 3 comments (which are now sorted from highest count to lowest)
comments [ 1 ] + ChrW (10) + comments [ 2 ] + ChrW (10) + comments [ 3 ]
In general, when Crystal Reports encounters a null valued field in a formula, it immediately stops evaluating the formula and produces no value. If you want to handle null field values in your formula, you must explicitly do so using one of the special functions designed for handling them: IsNull, PreviousIsNull or NextIsNull.
Title | # Comments | Views | Activity |
---|---|---|---|
Problem with exporting crystal report to PDF through ASP.NET | 23 | 60 | |
cross tab crystal reports - filter a row | 7 | 40 | |
How to Bold a formula within another formula | 4 | 24 | |
Formatting number to Text Format DDDDDDDDCC | 1 | 24 |
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
12 Experts available now in Live!