| View previous topic :: View next topic |
| Author |
Message |
tom General User

Joined: 17 Apr 2003 Posts: 6
|
Posted: Mon Apr 21, 2003 8:43 am Post subject: automatic adressing |
|
|
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 |
|
 |
JohnV Administrator

Joined: 07 Mar 2003 Posts: 8979 Location: Lexinton, Kentucky, USA
|
Posted: Mon Apr 21, 2003 3:56 pm Post subject: |
|
|
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 |
|
 |
tom General User

Joined: 17 Apr 2003 Posts: 6
|
Posted: Tue Apr 22, 2003 5:27 am Post subject: |
|
|
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 |
|
 |
JohnV Administrator

Joined: 07 Mar 2003 Posts: 8979 Location: Lexinton, Kentucky, USA
|
Posted: Tue Apr 22, 2003 9:58 am Post subject: |
|
|
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 |
|
 |
tom General User

Joined: 17 Apr 2003 Posts: 6
|
Posted: Tue Apr 22, 2003 11:38 am Post subject: |
|
|
>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 |
|
 |
tom General User

Joined: 17 Apr 2003 Posts: 6
|
Posted: Wed Apr 23, 2003 6:36 am Post subject: |
|
|
@ 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 |
|
 |
JohnV Administrator

Joined: 07 Mar 2003 Posts: 8979 Location: Lexinton, Kentucky, USA
|
Posted: Wed Apr 23, 2003 2:00 pm Post subject: |
|
|
Hi Tom,
Proves there is more than one way to skin a cat.
Good luck.
JohnV |
|
| Back to top |
|
 |
tom General User

Joined: 17 Apr 2003 Posts: 6
|
Posted: Thu Apr 24, 2003 6:17 am Post subject: |
|
|
>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 |
|
 |
|