Broken Break in FOREACH
Posted: Thu Apr 08, 2021 5:53 pm
Fixing one thing, tends to break another.
My company recently expanded to have offices in several locations. With the new locations, they have slightly-different customized logos, which we would want displayed at the top of all of our custom documents. The first new location is in Wilmington. The Header info just references the "Settlement Agent" contact information, so the only real change would be the icon itself.
I first thought about creating a 2nd Header ReadyBloc with the Wilmington logo, but then I would have to re-code EVERY. SINGLE. DOCUMENT. to check for Wilmington.
So next, I tried to create an IF statement in the header:
This worked to change the logo, but having the 2 icons in the table altered the dimensions and somehow removed the 2nd line of our address for either city.
Finally, I realized I could just use the same IF statement in the header, with the entire table for each city inside. Which worked like a charm! ... for single-page documents. We also have a multi-purpose Affidavit for sellers/borrowers to sign, that uses a FOREACH loop to create one document per person, and at the end of the first person's loop, it adds a break (Section Break/Next Page) and runs the 2nd person's loop. Which still works fine, EXCEPT that it no longer includes the break, and puts the header for the 2nd person's loop IMMEDIATELY after the 1st person's Notary section.
How can I "have my cake and eat it too" so to speak, or more specifically, have my dynamic icon and also include the page break?
My company recently expanded to have offices in several locations. With the new locations, they have slightly-different customized logos, which we would want displayed at the top of all of our custom documents. The first new location is in Wilmington. The Header info just references the "Settlement Agent" contact information, so the only real change would be the icon itself.
I first thought about creating a 2nd Header ReadyBloc with the Wilmington logo, but then I would have to re-code EVERY. SINGLE. DOCUMENT. to check for Wilmington.
So next, I tried to create an IF statement in the header:
Code: Select all
<IF ({{Order.SettlementAgents[1].Address.City}} = "Wilmington")>(Wilmington logo here)<ELSE>(regular logo here)</IF>
Finally, I realized I could just use the same IF statement in the header, with the entire table for each city inside. Which worked like a charm! ... for single-page documents. We also have a multi-purpose Affidavit for sellers/borrowers to sign, that uses a FOREACH loop to create one document per person, and at the end of the first person's loop, it adds a break (Section Break/Next Page) and runs the 2nd person's loop. Which still works fine, EXCEPT that it no longer includes the break, and puts the header for the 2nd person's loop IMMEDIATELY after the 1st person's Notary section.
How can I "have my cake and eat it too" so to speak, or more specifically, have my dynamic icon and also include the page break?