Single address derived field....

This forum is Read Only . If you feel a thread should be added to the FAQ please contact a moderator

Single address derived field....

Postby Paul Cheeseman » Wed Oct 06, 2010 2:06 pm

Ok, that was a bit vague! but what I want to do is have a virtual field that can show all the elements of a 7 field address, line by line, ommiting blank lines. The idea being that it can be used on things like invoices or labels without having to layout all the (7) fields. I also didnt want to have in each field a derevation that looks to see if the next field is blank etc.

so instead of
Paul Cheeseman
97 Some street

somewhere


east sussex
TN28 5EG


it shows as

Paul Cheeseman
97 Some street
somewhere
east sussex
TN28 5EG


I have use a concat() method before but it only shows one line and wraps to the next. (Paul Cheeseman, 97 Some street, somewhere, east sussex, TN28 5EG)

on messages, you can use the | | key to force next line, but that doesnt work.

Any ideas?

Paul
Paul Cheeseman
 
Posts: 87
Joined: Thu Sep 13, 2007 5:20 pm
Location: East Sussex
Has thanked: 0 time
Been thanked: 0 time
 

Re: Single address derived field....

Postby benjji » Wed Oct 06, 2010 2:41 pm

i had the same problem some years ago - and solved it by putting the whole address in a temp variable :
(and on the report body, make the temp field a multiline object)


define temp "tWholeAdd" text 255 .
define "crlf" text 3.

assign crlf := "
" .
for Form with Whatever ;

assign tWholeAdd := concat(CustomerName,
if(Address1 not= blank , crlf , blank ) , Address1 ,
if(Address2 not= blank , crlf , blank ) , Address2 ,
if(Address3 not= blank , crlf , blank ) , Address3 ,
if(Town not= blank , crlf , blank ) , Town ,
if(County not= blank , crlf , blank ) , County ,
if(Postcode not= blank , crlf , blank ) , Postcode ,
if(Country not= blank , crlf , blank ) , Country ) .
benjji
 
Posts: 167
Joined: Fri Mar 14, 2008 11:26 am
Location: Stoke-on-Trent & Manchester & Middlesborough
Has thanked: 0 time
Been thanked: 0 time
 

Re: Single address derived field....

Postby Adrian Jones » Wed Oct 06, 2010 3:21 pm

You need a derivation like this:

concat ( Address1 , if ( Address1 = blank , "" , "
" ) , Address2 , if ( Address2 = blank , "" , "
" ) , Town )

That is, the false condition for the if statements is a return in quotes.

To add a return in a field, type Ctrl-Return.

Make sure you have a closing bracket after the newline + quote.

Make sure that you set the field wherever you use it to be multiline (via the display options).
User avatar
Adrian Jones
 
Posts: 2000
Joined: Tue Sep 11, 2007 2:38 pm
Location: Cornwall, UK
Has thanked: 5 times
Been thanked: 4 times
 

Re: Single address derived field....

Postby Paul Cheeseman » Wed Oct 06, 2010 4:15 pm

do you know how long I have been trying to make that work ! :oops:

Great solutions, thanks

Problem solved. again :)

Regards

Paul
(more problems on way !)
Paul Cheeseman
 
Posts: 87
Joined: Thu Sep 13, 2007 5:20 pm
Location: East Sussex
Has thanked: 0 time
Been thanked: 0 time
 

Re: Single address derived field....

Postby Adrian Jones » Wed Oct 06, 2010 4:32 pm

I wonder if you might find my Fforward with Ffenics (and DataEase) workshop in Bristol, Nov 1-2, useful..

http://www.n10net.com/FfenicsWorkshop2010.aspx

:D
User avatar
Adrian Jones
 
Posts: 2000
Joined: Tue Sep 11, 2007 2:38 pm
Location: Cornwall, UK
Has thanked: 5 times
Been thanked: 4 times
 

Re: Single address derived field....

Postby Phil Winkler » Wed Oct 06, 2010 6:10 pm

Adrian, you really ought to webcast it or at least video tape it for later showing on Youtube, etc.

I'll attend if you do.
Phil Winkler
PLM Consulting, Inc.
pwinkler@plmconsulting.com
Phil Winkler
 
Posts: 889
Joined: Fri Sep 07, 2007 12:45 pm
Has thanked: 0 time
Been thanked: 0 time
 

Re: Single address derived field....

Postby Adrian Jones » Tue Oct 12, 2010 12:53 pm

Hi Phil,

I did video last year, but most of it looked horrible! Esp 'cause of screen flicker. And the fact that I wave my arms around like a windmill.

But you are right. I'll review again what thre is from last year and look into whatever options there are.

Also, In the New Year I might look at some webinars.
User avatar
Adrian Jones
 
Posts: 2000
Joined: Tue Sep 11, 2007 2:38 pm
Location: Cornwall, UK
Has thanked: 5 times
Been thanked: 4 times
 
 

Return to Ffenics FAQ

Who is online

Users browsing this forum: No registered users and 1 guest

cron