OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

automatic adressing

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Writer
View previous topic :: View next topic  
Author Message
tom
General User
General User


Joined: 17 Apr 2003
Posts: 6

PostPosted: Mon Apr 21, 2003 8:43 am    Post subject: automatic adressing Reply with quote

Hi!

I have a DB with a column wich contains th following elements:
m, w, f

m means male person
w means female person
f means firm

So what I am looking for is a way, that the template is automatically changing the adress field in Mister, Miss etc. while he gets the input from the DB.

In calc you can use the "=when"-Funktion (maybe with a hidden cell), but I did not found any equivalent solution (till now) for writer.

Has anybody an idea?
(Sorry for my bad English)

Tom
Back to top
View user's profile Send private message
JohnV
Administrator
Administrator


Joined: 07 Mar 2003
Posts: 9183
Location: Lexinton, Kentucky, USA

PostPosted: Mon Apr 21, 2003 3:56 pm    Post subject: Reply with quote

A field with only two possible values is easy the third value take a little more work.

Ctrl+F2 > Function tab > Conditional text. Set the Condition to Gender (or whatever your field name is) EQ “m”, set Then to Mr. and Else to Mrs. and then Insert. Put in a space and your name field. That takes care of two values

Now to handle the third possibility after the name field do Ctrl+F2 > Function tab > Hidden paragraph. Set the Condition to Gender EQ “f”. Insert this and then hit Enter.

On the next line insert just your name field and follow it with another Hidden paragraph with the Condition set to Gender NEQ “f”.

That should do it but here's something else you will probably want.

On the Function tab mentioned above you will also find “Hidden text”. If your fields were FirstName Initial LastName and you knew some Initial enters were blank you could do the following:

<FirstName>space<Initial><HiddenText><LastName>. Set the Hidden text Conditional to Initial EQ “” (if your DB uses NULL then EQ NULL). In the Hidden text box enter a single space which will be inserted after the Initial if there is one.

JohnV
Back to top
View user's profile Send private message
tom
General User
General User


Joined: 17 Apr 2003
Posts: 6

PostPosted: Tue Apr 22, 2003 5:27 am    Post subject: Reply with quote

Thank you, I will try this (When I managed to translate your advice;-)).
I am still trying OO out for the first time, so it is not the only problem I have. The other side is the language I am still not sure wether you (or others) will understand my questions and wether I understand your answers;-)

What about this (I also have not tried it yet):

3 hidden texts (paragraphs) at the same position, or do they cover eachother?
Does it also works with postgresql (I rather ask bevor I get made because of the errors that might come;-))!?

Tom
Back to top
View user's profile Send private message
JohnV
Administrator
Administrator


Joined: 07 Mar 2003
Posts: 9183
Location: Lexinton, Kentucky, USA

PostPosted: Tue Apr 22, 2003 9:58 am    Post subject: Reply with quote

Hi Tom,

>Does it also works with postgresql?
Yes, but you must make a connection to postgresql with an ODBC or JDBC driver. You will tthen be able to see your DB when you press the F4 key.

You can try things using the installed Bibliography DB. It can be edited to fit you problem.

Your English is good.

JohnV
Back to top
View user's profile Send private message
tom
General User
General User


Joined: 17 Apr 2003
Posts: 6

PostPosted: Tue Apr 22, 2003 11:38 am    Post subject: Reply with quote

>Yes, but you must make a connection to postgresql with an ODBC or JDBC driver. You will tthen be able to see your DB when you >press the F4 key.

The DB is already working fine (at least one think is okay;-))

Thank you for the advices and keep your fingers crossed that the rest will work.

I return with some other problems;-)
Back to top
View user's profile Send private message
tom
General User
General User


Joined: 17 Apr 2003
Posts: 6

PostPosted: Wed Apr 23, 2003 6:36 am    Post subject: Reply with quote

@ JohnV

I found a solution.

It works only with conditional text.
I placed them all in a "row" and every alternativ is set too "", so it disapear if the condition is false. Here it is with 5 fields:

m = "Dear Mister " ; DBnamefield
w = "Dear Miss " ; DBnamefiel
f = "Ladies and Gentelman (or what ever you write in English;-)"

5 fields just for one line, I can not wait till I write the adressfield;-)
Back to top
View user's profile Send private message
JohnV
Administrator
Administrator


Joined: 07 Mar 2003
Posts: 9183
Location: Lexinton, Kentucky, USA

PostPosted: Wed Apr 23, 2003 2:00 pm    Post subject: Reply with quote

Hi Tom,

Proves there is more than one way to skin a cat.

Good luck.

JohnV
Back to top
View user's profile Send private message
tom
General User
General User


Joined: 17 Apr 2003
Posts: 6

PostPosted: Thu Apr 24, 2003 6:17 am    Post subject: Reply with quote

>Proves there is more than one way to skin a cat.

Every cat is pleased to read this;-)
(I just could not manage the other advice of yours, but you showed me the way)

By the way, is there a possibillity to save those conditional text fields as "simple text", because after reopening, the DB-content disapeared and I had to chose the table-row again (Of cause I could save the document as pdf, but is there another way?)

tom
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Writer All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group