RHartmann
1st July 2008, 22:51
I have created AR statements. In the Header Text of the Statement Letters, I added the business partner name and address. After printing the city, there was a comma and then the state.
For Example: Boston, MA.
Then I changed the ACR Parameters, which deleted the headers.
I have been trying to recreate the headers, but there are now blanks at the end of the city.
For Example: Boston , MA.
How do you strip the blanks at the end of the city, insert a comma and then print the state? I want it to look like: Boston, MA

Can I default to the Business Partner's Address Format?

Thanking you in advance for the help.

günther
2nd July 2008, 09:12
I checked it on my system (c4) and it seems that text variables do not contain trailing blanks, so I could use e.g. "$name, $namf". (#name does not make sense here).

Then I checked how I could work around and found the following way:
"#{ strip(name) & ", " & strip(namf) }". (I had to use # here, because ${ ... } gave errors on my system ...).

Hope that helps.

RHartmann
2nd July 2008, 16:37
Thank you so much, Günther, it worked!

The odd thing is that it must have used our address formats before I updated the ACR parameters.
When we mail locally, we do not want to show the country in the address. When we mail internationally, we do want to show the country. Now, I think that I'll have to have a different statement letter for international business partners and format the header to include the country.

günther
2nd July 2008, 16:49
Nice to hear that it worked.

Now to your other problem: I'm not sure if the following really works, but I would at least try it ...

Let's say you have two reports connected to session tfacr3420m000 - the second one could be a copy of the original one and renamed to "... (international)".

Both reports get a variable "extern domain tcmcsl.long mode", and in the before.program section the first reports sets mode=1 and the second reports sets mode = 2.

Now, since we can use expressions in the header text, you could check

#{ (mode=1) ? name : strip(name) & ", " & strip(namf) }

or something like that. Have a look at expr.compile() for all possibilities.

Hope that works, too!

Günther

RHartmann
2nd July 2008, 21:02
Günther, thanks for the programming tip. I will try that out, but in the meantime I decided to change the ACR parameters back to the previous version. The "Enable Variables For Reminder Text" is now unchecked.
Although it removed my header again, the business partner and address print automatically on the AR Statement, without selecting the variables from the zoomsession.
So, using only one Statement Letter, it prints the business partner correctly no matter how many lines of address are involved, based on the address format. It prints the country for the international business partners and also multiple address lines when necessary.
It seems that if you check "Enable Variables For Reminder Text", this data does not automatically print and leaves it up to the user to choose what should print.