Mailmerge, working, fairly well, but...

Mark Stanton wrote (10-02-12 08:43)

If there are few available pictures to choose from, it could work with
conditional hidden paragraphs.

Only two pictures, a first class stamp or a second class stamp, according
to whether the address is outside or inside the UK, so it's very simple
in that respect.

:slight_smile:

So, you're saying that I put the anchor point in a paragraph and making
the paragraph hidden will hide the picture?

Correct. Maybe place the picture as character too. Just try.
I work with conditional paragraphs, condition:
   <DATASOURCE NAME>.<TABLE NAME>.<FIELR NAME> EQ ""

You could of course use a different condition.

If that's right it should be fairly simple. A bit of a nuisance because
the two stamps will appear in (very) slightly different places on the
page (one paragraph up or down), but I also don't care about such trivia.

Add an extra line (shft-Enter) to the paragraph might be of some help?

Regards,

Hi Andreas,

Personally I do not care about cosmetic trivia like an empty line in an
address frame. But replacing the database field with nothing when the
content is an empty string should be doable.

Nor do I, one blank line here or there isn't much in my standardised
address forms.

I do not have the academic degree to understand the infamous streaming
document on the OOo developer site. And I am very confident that even
the best fabricated byte stream will not work in the context of the data
access API which is obviously broken beyond repair.

Broken yes, beyond repair, well, you never know. At least one person has
decided that Base programming is worth looking into, Lionel Mamane, who
is currently attempting to handle many of the bug fixes for Base.

Alex

Hi Mark,

No, that's not quite my question. There will *always* be a picture, and it
is either a picture of a first class stamp or a second class one. But I
want whichever stamp it is to appear in (almost) the same place according to
destination (international or domestic). See my answer to Cor "below".

Oh sorry, my misunderstanding. I'm afraid I can't help you with that
from the Writer UI perspective. I would probably attempt to build my ODT
document using one of the many programming interfaces, e.g. Perl, or
PHP, which have classes for manipulating ODF files and letting you
fiddle around with the bits that are there, but the user doesn't get
easy access to without programming, which means that you don't even have
to open LO at all to get a result (well except maybe to check that it
looks OK). I find OOoBasic a bit too, hmmm, cantankerous for my taste.

I had thought the anchor point was outside the paragraph structure, but that
appears not to be the case, and y'all seem to be saying that hiding or
showing the paragraph that the anchor is in will hide or show the picture
anchored to it.

If that's right, then that is my solution.

I did have another thought, from the dregs of my memory : there was a
French guy, going by the pseudo "bobiciel", who managed to do some
rather impressive things (well at least I thought so at the time) with
"User Variables". There might still be some documentation of his lying
around in the arcanes of the net, because I don't remember exactly how
he did it.

Alex

Hi Mark,

So, you're saying that I put the anchor point in a paragraph and making
the paragraph hidden will hide the picture?

If that's right it should be fairly simple. A bit of a nuisance because
the two stamps will appear in (very) slightly different places on the
page (one paragraph up or down), but I also don't care about such trivia.

How about if you create 2 sections, one for each stamp, and make each
section conditionally (in)visible (assuming that is possible of course,
I haven't checked) ?

Alex

Hi :slight_smile:
There are other people looking into doing some Base programming but Lionel is a bit of a star.
Regards from
Tom :slight_smile:

Tom Davies wrote (10-02-12 12:18)

There are other people looking into doing some Base programming but Lionel is a bit of a star.

Can't you do something more useful then spamming this list, Tom ?
I'll be happy to chat/write with you to see if there are areas of interest where you feel comfortable, happy and such, and where some help is welcome.

Thanks,
Cor

(Tried to bite my tongue, missed it. Sorry)

Am 10.02.2012 08:43, Mark Stanton wrote:

No, that's not quite my question. There will *always* be a picture, and it
is either a picture of a first class stamp or a second class one. But I
want whichever stamp it is to appear in (almost) the same place according to
destination (international or domestic). See my answer to Cor "below".

Thank you for clarification.
Store the pictures as files.

SELECT * , CASE WHEN "INT" THEN 'fileA.png' ELSE 'fileB.png' END AS "PicFile"
FROM "Table"

Print the mail merge to a document.
Run a post-processing macro to replace "fileA.png" and "fileB.png" with the respective picture.

Might I suggest placement within a query based on database of stamp image.
1 for 1st class, otherwise 0.
Then use query in form.