StrataFrame Forum

Regarding the FormatString Properties

http://forum.strataframe.net/Topic22326.aspx

By Philipp Guntermann - 3/12/2009

Hi,

is it possible to write a FormatString that only puts a whitespace in case the next field is not empty ?

My FormatString looks like this:

{1} {2}, {5}-{3} {4}

1= Adressfield1, 2=Adressfield2, 5=CountryShortcut, 3=postal code, 4=city

however, the field Adressfield2 may or may not have a value, and thus if it doesnt have a value,

the whitespace infront of it needs to go.

any ideas ?

thanks.

By Trent L. Taylor - 3/12/2009

You will have to take this into account yourself.  We have a DataHalpers static (shared) class that we have do all of this for us.  SO when we have an address or name, we pass it over to these methods and it takes care of it for us.  If we need it in a list, etc, then we will either handle the RowPopulating event or create a custom property on the BO that calls this method for us.

DataHelpers.FormatAddress(Add1, Add2, City, StateOrProvince, Postal)
By Philipp Guntermann - 3/12/2009

i see

thanks.