Issue 34992 - Mail merge imports zeros instead of blank space
Summary: Mail merge imports zeros instead of blank space
Status: CLOSED DUPLICATE of issue 36869
Alias: None
Product: Writer
Classification: Application
Component: code (show other issues)
Version: OOo 1.1.2
Hardware: PC All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: Oliver Specht
QA Contact: issues@sw
URL:
Keywords: oooqa
Depends on: 31472
Blocks:
  Show dependency tree
 
Reported: 2004-10-05 10:37 UTC by tuharsky
Modified: 2008-05-17 23:42 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
spreadsheet with data (5.38 KB, application/vnd.sun.xml.calc)
2004-10-05 14:33 UTC, tuharsky
no flags Details
Text file importing data from the spreadsheet (5.40 KB, application/vnd.sun.xml.writer)
2004-10-05 14:34 UTC, tuharsky
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description tuharsky 2004-10-05 10:37:17 UTC
I defina data source from Spreadsheet, and there are some blank cells. I create
form with fields that connect to the spreadsheet.

If I do Mail merge (e.q. I Print), the correct values are placed to form from
the cells where any value is defined. But if cell is blank, the "0" is placed to
printed form instead of blank place.

Since the cells are visibilly blank (no value defined), the Mail Merge shouldn't
generate the "0" value himself.
Comment 1 eric.savary 2004-10-05 12:07:35 UTC
Please add the spreadsheet + Writer document to the issue.
Comment 2 tuharsky 2004-10-05 14:33:26 UTC
Created attachment 18139 [details]
spreadsheet with data
Comment 3 tuharsky 2004-10-05 14:34:22 UTC
Created attachment 18140 [details]
Text file importing data from the spreadsheet
Comment 4 tuharsky 2004-10-05 14:37:38 UTC
I did it with 1.1.3 RC SK, GNU/Linux, with the same result.
You can see, that after merge, row with "Jozo" is folowed by "0", although the
cell is empty and was not touched at all.
Comment 5 tuharsky 2004-10-06 14:49:03 UTC
Please, is there any possibility to workaround the problem until it is fully
repaired in OOo?
Comment 6 Rainer Bielefeld 2004-10-06 17:51:13 UTC
Also saw it with 1.1.2RC3  (German) WIN XP: [645m44(Build8784)]
Due to  comments from tuharsky Tue Oct 5 06:37:38 -0700 2004 --> All OS

May be "database access" could be a better Component?

Please also have a look on issue 31472!


Rainer
Comment 7 Rainer Bielefeld 2004-10-06 18:18:13 UTC
Until today I really did not understand all aspects of that import format
function. I sometimes had the same problem, but I always thought, it would be my
mistake. I was able to get it working by 
- formatting column 2 of 'pokus_nula.sxc' as "text"
- insert a new line as first line with a non number content like "X1X"
- formatting field <SUMA> in 'pokus_nula_b_text.sxw' as text.

I had to do all 3 changes to get the correct result, but this only is a very
first test result.
May be, OOo decides, that a column only contains numbers, if there is a number
in the first row of the column?

By the way, I made my tests with the attached data source, but a little changed
text document: I copied several identic data fields below the first one of the
existing one, all with an added 'Next record' field at the and. So I can quickly
see the result after "Data to Fields" - click.

Rainer
Comment 8 Rainer Bielefeld 2004-10-06 18:18:37 UTC
Until today I really did not understand all aspects of that import format
function. I sometimes had the same problem, but I always thought, it would be my
mistake. I was able to get it working by 
- formatting column 2 of 'pokus_nula.sxc' as "text"
- insert a new line as first line with a non number content like "X1X"
- formatting field <SUMA> in 'pokus_nula_b_text.sxw' as text.

I had to do all 3 changes to get the correct result, but this only is a very
first test result.
May be, OOo decides, that a column only contains numbers, if there is a number
in the first row of the column?

By the way, I made my tests with the attached data source, but a little changed
text document: I copied several identic data fields below the first one of the
existing one, all with an added 'Next record' field at the and. So I can quickly
see the result after "Data to Fields" - click.

Rainer
Comment 9 tuharsky 2004-10-07 09:38:50 UTC
The data we work with are "live" -we cannot format them as text because there
are more processes running among them and they need to stay as numbers.

Thank You very much anyway.
Comment 10 eric.savary 2004-10-07 10:53:06 UTC
If you cannot change the format of this column, you can influence the output of
the field in the document using a conditional field:
- Set the cursor where the the SUMA field should appear
- Insert - Fields - Others - Functions - Conditional text:
   * Condition: [MyBase.MyTable.SUMA] <> 0
   * Then: MyBase.MyTable.SUMA
   * Else:
Notice:
- Of course, you should replace the names of this example with the real names of
your database, table and field. Easy way:
   * let the table show in the database beamer (pressing F4 in the text document)
   * Call the fields dialog as described above
   * point your mouse cursor, in the background of the dialog, on the column
header of the SUMA (or whatever) fiel.
   * Drag&Drop in the Condition i.e Then text field of the dialog
- 'Else': yes, leave it empty.

Hope this helps!

May I close the issue for there is no bug here?
Comment 11 tuharsky 2004-10-07 13:36:41 UTC
Wait, dear friend, how do You mean that "there is not bug here"?

In the data source, there is No_value. After properly using Mail Merge, OOo
places the "0" instead of "No_value" ("nothing" placed). In fact, OOo generates
data himself and thus changes the data the user inserted. I hope it's clear that
"0" and "No_value" are different kind of data?!

There's no reason why the user should take any special action to get the correct
result ("No_value" resp. blank field) from his data that are correct.

I'm going to try the workaround You suggested.
Comment 12 tuharsky 2004-10-07 13:54:41 UTC
Thanks for the workaround, it dosen't work however. It correctly places blank
field where cell is empty, but it places the cell location (Table.Sheet.Field)
where value should be placed.
Comment 13 eric.savary 2004-10-07 17:27:53 UTC
- The workaround: please attach your test document with the workaround, I think
you have a mistake in the condition syntax....

- no bug: maybe multiple possiblities...

ES->OS: as I understand the field format conversion/evaluation between CALC ->
DB -> Writer field we can Improve this evaluation/display of value:
- As DB source, we have a spreadsheet with a field set as NUM and some empty
values. If I test in Calc those empty fields, I get:
   * ISNUMBER()=FALSE
   * ISBLAN()=TRUE
so, not a number and nothing at all. Thus, the internal value of the field
should be something like NULL or -1....
- in the DB Beamer, those empty fields are shown.. empty! i.e, the DB evaluates
those fields correctly
- inserted as fields in the Writer they appear as 0 -> which isnot true because
Calc and DB evaluate those fields as NULL. we should do the same and display
nothing..
Comment 14 Rainer Bielefeld 2004-10-07 18:54:44 UTC
Hi Es, I agree with tuharsky, this really at least is not "userfriendly" because
the result in the mail merge form is completely unexpected. 

I also think that that's a bug until someone can tell me a good reason, why
"nothing", (what is something different from the number "0"), should be shown as
the number "0" in a mail merge field, that is formatted as "text".

I also agree with Additional comments from es Thu Oct 7 09:27:53 -0700 2004 

@Es, @tuharsky: it would be interesting to find out why that workaround with
"Condition: [MyBase.MyTable.SUMA] <> 0 ..." did not work. I would have done it
in the same way - but I must admit that most of my "conditional text solutions
do not work :-( . But of course, that can not be a real workaround, because some
field might contain the number "0"!
Of course that workaround is quite desperate last possibility.

I made some further tests with the attached documents and found out:
My tests with attached 'pokus_nula.sxc' and my own test file similar
'pokus_nula_b_text.sxw' (but 4 times the same line like line 1 and a 'Next
record' at the end of each line, I get e correct "nothing" after "Jozo", if I
change the contents of 'a2' from "100" to "abc". No further tricks are necessary
like "Format as text" or something else. Today I can not confirm my
observations, that also "Format as text" in spreadsheet and for mail merge
fields is necessary. Funny thing!

@Tuharsky, , can you confirm my observations?

Rainer
Comment 15 Rainer Bielefeld 2004-10-10 18:44:31 UTC
My observations 'Thu Oct 7 10:54:44 -0700 2004' are confirmed in issue 31472 by
'Additional comments from clu Tue Sep 14 01:39:18 -0700 2004'. That's not
userfriendly, but I have too poor knowledge to create a RFE.

Rainer
Comment 16 Oliver Specht 2005-05-17 08:20:32 UTC
.

*** This issue has been marked as a duplicate of 36869 ***
Comment 17 ace_dent 2008-05-17 21:38:26 UTC
The Issue you raised has been marked as 'Resolved' and not updated within the
last 1 year+. I am therefore setting this issue to 'Verified' as the first step
towards Closing it. If you feel this is incorrect, please re-open the issue and
add any comments.

Many thanks,
Andrew
 
Cleaning-up and Closing old Issues
~ The Grand Bug Squash, pre v3 ~
http://marketing.openoffice.org/3.0/announcementbeta.html
Comment 18 ace_dent 2008-05-17 23:42:09 UTC
As per previous posting: Verified -> Closed.
A Closed Issue is a Happy Issue (TM).

Regards,
Andrew