Menu

#3 ooo_mailmerge make produce the final document

open
nobody
None
5
2015-03-31
2015-03-30
mimooh
No

As I understand and from what I tested this is how ooo_mailmerge works:

template.odt: one page with three fields: field1 field2 field3

1.csv "a","b","c"
2.csv "x","y","z"

ooo_mailmerge results in 2 pages document, fine, but the content:
page1: field1 field2 field3
page2: field1 field2 field3

And I still need to make to substitutions inside libreoffice. Can I have
the substitutions done without launching libreoffice and get:
page1: a b c
page2: x y z

?

Discussion

  • Ralf Schlatterbeck

    On Mon, Mar 30, 2015 at 08:58:44AM +0000, mimooh wrote:

    As I understand and from what I tested this is how ooo_mailmerge works:

    template.odt: one page with three fields: field1 field2 field3

    1.csv "a","b","c"
    2.csv "x","y","z"

    You should have one .csv file here with the following content:

    field1;field2;field3
    a;b;c
    x;y;z

    Merging that with a one-page template.odt with the given three fields
    this should result in a new document with two pages. The first page
    should have field1 replaced with a, field2 with b, field3 with c. The
    second page should have x,y,z instead.

    If that doesn't work, please submit all documents (the initial template
    document and the result after mailmerge) together with the .csv file
    used. The documents should not contain any confidential information. If
    it reproduces a bug, I use such documents to add to my tests which are
    released publicly. So please make sure that the document is in a state
    that you want to be part of a public test suite.

    When submitting a bug-report, please make sure to indicate what you're
    seeing -- you may have a different version of OpenOffice or LibreOffice,
    so what you're seeing might not be the same as I'm seeing. And please
    indicate the version of office program you're using.

    Thanks,
    Ralf
    --
    Ralf Schlatterbeck email: ralf@zoo.priv.at

     
  • mimooh

    mimooh - 2015-03-31

    You should have one .csv file here with the following content:
    field1;field2;field3
    a;b;c
    x;y;z
    Surely, that was an error of mine. One csv filled with the records, right.

    Merging that with a one-page template.odt with the given three fields
    this should result in a new document with two pages. The first page
    should have field1 replaced with a, field2 with b, field3 with c. The
    second page should have x,y,z instead.
    Yes. Doesn't work. The screenshot portraits the collection of windows:
    1. in.csv (the database)
    2. template.odt (<f1> & friends entered by Insert > Fields > Database > in.csv
    3. libreoffice@ubuntu
    4. out.odt (the final document). Certainly f1 not substituted with "a".
    I need to proceed to File > Print > as mailmerge to have the substitutions.</f1>

    I attach the screenshot and the collection of all the files.

     
    • Ralf Schlatterbeck

      On Tue, Mar 31, 2015 at 08:31:11AM +0000, mimooh wrote:

      Yes. Doesn't work. The screenshot portraits the collection of windows:
      1. in.csv (the database)
      2. template.odt (<f1> & friends entered by Insert > Fields > Database > in.csv
      3. libreoffice@ubuntu
      4. out.odt (the final document). Certainly f1 not substituted with "a".
      I need to proceed to File > Print > as mailmerge to have the substitutions.</f1>

      Thanks!
      You're using database fields, replacement for these is currently not
      implemented (although it would probably not be much effort).

      The fields you should use are found in the menu
      Insert -> Fields -> Other
      Then under "Variables" (not "Database") select "Set variable", specify a
      Name and a Value and for the Format specify "Text".

      I've attached a document with this type of field and replecement with
      ooo_mailmerge is working (for me) for this document.

      Ralf

      Ralf Schlatterbeck email: ralf@zoo.priv.at

       
      • mimooh

        mimooh - 2015-03-31

        Hmmm...

        1. I'd say most people would relate mailmerge with database. It was news to me and my collegues that there is another way (Fields > Other).

        2. Still doesn't work for me - tried your version and your template.odt and got the same results: f1, f2, f3 grey fields on two pages - still no substitution.

        3. What I am missing in your Insert > Fields approach is how would one point the data source inside libreoffice (not by the external ooo_mailmerge tool)? There's no dialog, no place to specify my file with the records. I suspect the Insert > Fields > Other was not designed as mailmerge at all! You are just using some side effects and created your own way of mailmerge. And just as I started to suspect this, I found another evidence: what would be the meaning of Name and Value under Insert > Fields > Other? This seems to serve some other purposes. Wouldn't you agree?

        regards,
        Karol

         

        Last edit: mimooh 2015-03-31
        • Ralf Schlatterbeck

          On Tue, Mar 31, 2015 at 02:38:36PM +0000, mimooh wrote:

          Hmmm...

          1. I'd say most people would relate mailmerge with database. It was
            news to me and my collegues that there is another way (Fields >
            Other).

          Yes, this was a way to generate mailmerge-like office documents from
          inside a web application. The users could use different templates that
          way.

          1. Still doesn't work for me - tried your version and your
            template.odt and got the same results: f1, f2, f3 grey fields on two
            pages - still no substitution.

          Maybe you need to update the fields under Tools -> Update -> Fields?
          If that doesn't do the trick, can you send me the resulting output file?
          (I trust that you're using the file from my last message as your
          template, if not, please also send me the template file used)

          1. What I am missing in your Insert > Fields approach is how would one
            point the data source inside libreoffice (not by the external
            ooo_mailmerge tool)?

          This was never the design intention. If you're doing it interactively
          anyway from inside libre office you can use the builtin mailmerge.

          There's no dialog, no place to specify my file with the records. I
          suspect the Insert > Fields > Other was not designed as mailmerge at
          all! You are just using some side effects and created your own way of
          mailmerge. And just as I started to suspect this, I found another
          evidence: what would be the meaning of Name and Value under Insert >
          Fields > Other? This seems to server some other purposes. Wouldn't you
          agree?

          As said above: This was designed to create a mailmerge-like document
          from a web application. To my knowledge the 'Other' fields don't have a
          specified use-case and are as good as any other for the given purpose.

          Ralf

          Ralf Schlatterbeck email: ralf@zoo.priv.at

           
          • mimooh

            mimooh - 2015-04-02

            Maybe you need to update the fields under Tools -> Update -> Fields?
            If that doesn't do the trick, can you send me the resulting output file?
            Doesn't work. See the attachment.

            As it comes to other aspects I am not questioning it: maybe Insert > Fields it the good way to go. I just never seen it before.

             
  • mimooh

    mimooh - 2015-03-31

    And the screenshot

     

Log in to post a comment.