Mailmerge, working, fairly well, but...

Ok, I've got mailmerge working, fairly well, ish.

It seems a little unhelpful that the "view field names" overrides
conditional hidden paragraphs, completely nullifies their effect even
on printing it seems. It cetainly should nullify their effect during
edit, but not printing imnvho.

Anyway, what I need now is conditional hidden graphics according to
database field. Not "pick a graphic", just show a selected graphic
if a database field is a certain value. In case you're wondering,
this is so I can print either a first clas stamp image or second,
depending whether the address is outside the UK.

Since the graphic isn't "in" a paragraph it looks like that strategy
won't work, and I can't see another way of doing it at the moment.
Macros?

TIA
Mark Stanton
One small step for mankind...

Mark ,

For proper mailmerging, read personalysing your output, macro's are the only way to go a good start can be to google for a French tool (set of macro's) "publipostage OpenOffice"

Hope it helps

Fernand

Thanks Fernand,

I'll go look.

Regards
Mark

Hi Fernand,

Fernand Vanrie wrote (06-02-12 09:08)

For proper mailmerging, read personalysing your output, macro's are the
only way to go a good start can be to google for a French tool (set of
macro's) "publipostage OpenOffice"

Hmm, do you have a proper link. I find a whole lot of stuf, but no tool set...

Thanks,

Howdy all,

There was also a fellow in Germany a couple years back who put together
a Base system for managing a Dance School - this included a nice set of
tools for doing mail merge IIRC - I'll root around a bit and see if I
can come up with that link, in addition to what Fernand is referring
to.

//drew

Cor ,

Sorry "publipostage" was een beedtje breed :slight_smile:

the basic code you will find here <http://www.oooforum.org/forum/viewtopic.phtml?t=4957>

When needed i can post more code (replacing pictures etc....) based on the same principles

Greetz

Fernand

Yup, same here. I found nice manuals, but all just basic ones (not
"Basic"), and no macros.
The forum post looks like it's got some useful ones, but no
conditional pictures, unless I missed that.

Regards, and thanks
Mark Stanton
One small step for mankind...

The thing that started this thread though was my need for conditional
pictures. Can that be done without macros?

Regards
Mark Stanton
One small step for mankind...

hallo Mark ,

The thing that started this thread though was my need for conditional
pictures. Can that be done without macros?

In theory we can use a WRITER DOC a FORM and a IMAGECONTROL, but even after i resolved the problem to store image-data in a database field, and pointed the imagecontrol to this databasefields, the imagecontrol do not show the image.
Others tried also find there views here <http://sheepdogguides.com/fdb/fdb1imag.htm>

using macro's to control is pretty simple, when needed i can post the code here !

greetz

Fernand

Mark,
  me again,

I did a bit more testing, now i can store en review a image in a database, using a Form and a image control, but there is still the problem that there is nothing like a "imagefield" to recall and show the stored image date when running a "merge" operation.

Fernand

Hi Fernand,

I did a bit more testing, now i can store en review a image in a
database, using a Form and a image control, but there is still the
problem that there is nothing like a "imagefield" to recall and show the
stored image date when running a "merge" operation.

AFAIK, the only way to do this is to use a macro to read the binary stream of the image, and then find some way of converting it to something that can be inserted into a document and displayed...

I remember Frank Schoenheit mentioning that this was problematic indeed even with OOo.

Alex

Mark Stanton wrote (09-02-12 12:35)

The thing that started this thread though was my need for conditional
pictures. Can that be done without macros?

Ah, did miss the start of the thread.
Depends on the amount / size of pictures of course.
With random pictures, as the data itself, I would not know.
If there are few available pictures to choose from, it could work with conditional hidden paragraphs.

Cheers,

Am 09.02.2012 20:14, Alex Thurgood wrote:

Hi Fernand,

I did a bit more testing, now i can store en review a image in a
database, using a Form and a image control, but there is still the
problem that there is nothing like a "imagefield" to recall and show the
stored image date when running a "merge" operation.

AFAIK, the only way to do this is to use a macro to read the binary
stream of the image, and then find some way of converting it to
something that can be inserted into a document and displayed...

I remember Frank Schoenheit mentioning that this was problematic indeed
even with OOo.

Alex

I use to store pictures as references to files in the same directory as the odb document. This way all you need to store in a VARCHAR field is the file names of the pictures. In a form you can bind a picture control to the text field and you will not encounter the usual performance problems.

When you import the text field content into a serial letter, all you need is a macro to replace the text field with a picture object linked to the external file (anchor as character, fixed size,...).

Hi Fernand,

I'm quite happy with the (idea of the) macro solution, I was just
interested if there was another simpler/easier one.

I really don't want to put images in a table, particularly in this
case where the picture is either 'A' or 'B', although I s'pose if I
can get it there as a result of a query it might be just about
bearable.

What I'd really like is an image control with a conditional display
expression. I may try to produce one, but not for a while I think.

Regards
Mark Stanton
One small step for mankind...

Hi Andreas,

I use to store pictures as references to files in the same directory as
the odb document. This way all you need to store in a VARCHAR field is
the file names of the pictures. In a form you can bind a picture control
to the text field and you will not encounter the usual performance
problems.

When you import the text field content into a serial letter, all you
need is a macro to replace the text field with a picture object linked
to the external file (anchor as character, fixed size,...).

Agreed, but can you set it up to make the paragraph as invisible depending on whether or not you have a varchar string ? I imagine so, but that is the question that the original poster was asking. Your macro would need to take care of that piece of trickery in order to mark the paragraph/section where the image is to be inserted as hidden when equal to NULL.

Alex

Am 09.02.2012 21:58, Alex Thurgood wrote:

Agreed, but can you set it up to make the paragraph as invisible
depending on whether or not you have a varchar string ? I imagine so,
but that is the question that the original poster was asking. Your macro
would need to take care of that piece of trickery in order to mark the
paragraph/section where the image is to be inserted as hidden when equal
to NULL.

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.
Nevertheless, my idea will not work since you can not replace the placeholder field with its file name content since the placeholder is just that.
But anything along that line should work after you printed into another odt document and keep track of the places where the picture should be placed (or not). I am not familiar with Writer.
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.

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.

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.

Regards
Mark Stanton
One small step for mankind...

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".

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.

It would be much nicer to have an image field that could be conditionally
hidden...

Mark Stanton
One small step for mankind...

Alex ,

I agree, but Sam asked for a non macro solution, the rest (binary stream storing etc...) can been done. We never use images stored in a database, we simply change the links pointing to images stored on a fileserver.

Greetz

Fernand

Hi Mark,

It would be much nicer to have an image field that could be conditionally
hidden...

File a Request for Enhancement bug report. You never know, someone
someday might take it up <grin>, but it almost certainly won't be in the
near future.

Alex