Still based on this
Right now, I am able to make an output correctly, something like this:
Notes:
1. Tenant 1 ceased its operation on date
2. Tenant 2 ceased its operation on date
3. Tenant 3 started its operation on date
I needed to modify it again by editing the ordering of notes. those tenants who started on a certain date should come first, then those who ceased shall follow, currently they are on alphabetical order because the details section is on listed alphabetically.
What I initially do for this is to separate the formula in the DETAILS SECTION, to something like this:
Formula 1
Whileprintingrecords;
stringvar strstarted;
stringvar strceased;
stringvar strtitle;
numbervar var;
(
if ({@CurrentMonthNew}) <> "CLOSED" and ({@PreviousMonthNew}) = "Not yet operational"
THEN
(if (var = 0)
then
strstarted := strstarted + "<b>Notes:<b>" + "<br> " + cstr((var := var+1;),0) + ". " + '<Font color = "Orange"><b>' + {@NameProperCase} + '<b></font>' + " started its operation on " + cstr({@FirstDate}) + "."
//strtitle := strtitle + ChrW(13) + cstr((var := var+1;),0) + ". " + {@NameProperCase} + " started its operation on " + cstr({@FirstDate})
else
strstarted := strstarted + "<br> " + cstr((var := var+1;),0) + ". " + '<Font color = "Orange"><b>' + {@NameProperCase} + '<b></font>' + " started its operation on " + cstr({@FirstDate}) + "."
)
);
Formula 2:
evaluateafter({@notes});
stringvar strstarted;
stringvar strceased;
stringvar strtitle;
numbervar var;
(
if ({@CurrentMonthNew}) = "CLOSED" and ({@PreviousMonthNew}) <> "CLOSED"
THEN
(if var = 0
then
strceased := strceased + "<b>Notes:<b>" + "<br> " + cstr((var := var+1;),0) + ". " + '<Font color = "Orange"><b>' + {@NameProperCase} + '<b></font>' + " ceased its operation on " + cstr({@LastDateforNotes}) + "."
//strtitle := strtitle + ChrW(13) + cstr((var := var+1;),0) + ". " + {@NameProperCase} + " ceased its operation on " + cstr({@LastDateforNotes})
else
strceased := strceased + "<br> " + cstr((var := var+1;),0) + ". " + '<Font color = "Orange"><b>' + {@NameProperCase} + '<b></font>' + " ceased its operation on " + cstr({@LastDateforNotes}) + "."
)
);
I separate the formula and use Evaluate After to make sure that formula 1 should be implemented first to achieve the desired and expected output, BUT IT IS NOT WORKING.
OUTPUT SHOULD BE
Notes:
1. Tenant 3 started its operation on date
2. Tenant 1 ceased its operation on date
3. Tenant 2 ceased its operation on date