Bug 118391 - Image Control in Mail Merge Document only displays first result.
Summary: Image Control in Mail Merge Document only displays first result.
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.0.5.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-26 11:13 UTC by debug@roosoft.ltd.uk
Modified: 2018-08-15 19:45 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Output Document (8.79 KB, application/vnd.oasis.opendocument.text)
2018-06-26 11:47 UTC, debug@roosoft.ltd.uk
Details
Document Template (8.83 KB, application/vnd.oasis.opendocument.text)
2018-06-26 11:48 UTC, debug@roosoft.ltd.uk
Details
LogoTest Database (441.70 KB, application/vnd.oasis.opendocument.database)
2018-06-27 07:21 UTC, debug@roosoft.ltd.uk
Details

Note You need to log in before you can comment on or make changes to this bug.
Description debug@roosoft.ltd.uk 2018-06-26 11:13:20 UTC
Description:
When trying to print out images direct from a DB with a query only the first Image is show and repeated in the image control for all other rows while the other fields change correctly. A form generated from the DB will behave correctly with the same settings in the image control 

Steps to Reproduce:
1.Create a DB. Can be Embedded or remote. Create a Table called LOGOS with 3 Fields. ID. Int Autovalue, IMAGE, VARBINARYIMAGE, NAME, VARCHAR. 

2. Create Query for the Table QueryLOGOS. 

3. Create a Form from the Query and populate the DB with an IMAGE and a NAME

4. Save DB

5. Create a Writer Document and link it to the DB-Query via the Dataview.

6. Add fields from the Query for ID and NAME. Add an Image control and Link that to IMAGE in the query.

7. Save Document

8. Print docuemnt. It will ask to mail merge say yes. Save as a single file.

Actual Results:
The first logo in the query is repeated for all entries while the fields update correctly.

Expected Results:
The image should change as the fields do 


Reproducible: Always


User Profile Reset: No


OpenGL enabled: Yes

Additional Info:
There needs to be a better way to debug such issues. Perhaps some sort of sanity check if the options are not what they are supposed to be.
Comment 1 debug@roosoft.ltd.uk 2018-06-26 11:47:16 UTC
Created attachment 143127 [details]
Output Document

This is the output doc
Comment 2 debug@roosoft.ltd.uk 2018-06-26 11:48:24 UTC
Created attachment 143128 [details]
Document Template

Template Document to generate Mailmerge document.
Comment 3 debug@roosoft.ltd.uk 2018-06-26 11:51:18 UTC
The example db file can be found at this link.

https://www.file-upload.com/et5kznil7c2e
Comment 4 debug@roosoft.ltd.uk 2018-06-27 07:21:06 UTC
Created attachment 143153 [details]
LogoTest Database

The sameple Database.
Comment 5 Drew Jensen 2018-07-30 13:38:38 UTC
First, you aren't doing what you think you are doing, I think.

As you saw mail merge fields do not include image fields. 

The two mail merge fields and the three individual image controls are not linked to each other in any way. The fact that the two types of items (fields and controls) are from the same datasource is of no relevance.


If you want to do just what you want to do there is a totally different way to go. Create a report in Base.
Comment 6 Buovjaga 2018-08-11 06:41:04 UTC
(In reply to Drew Jensen from comment #5)
> If you want to do just what you want to do there is a totally different way
> to go. Create a report in Base.

Debug: are you happy with this answer?
Comment 7 debug@roosoft.ltd.uk 2018-08-11 22:10:32 UTC
> Debug: are you happy with this answer?

Not especially. Base reports don't allow page size restrictions in the same way that Documents does. That is to say I am trying to print out on an industrial label printer and it will not let me set zero margins nor let me make sure the text lines are x far apart to fit in constricted space. 

As it is not I have to print the Document as a PDF form and let people fill out what they need by hand before printing out. 

Not ideal.
Comment 8 Drew Jensen 2018-08-11 22:21:04 UTC
(In reply to debug@roosoft.ltd.uk from comment #7)
> > Debug: are you happy with this answer?
> 
> Not especially. Base reports don't allow page size restrictions in the same
> way that Documents does. That is to say I am trying to print out on an
> industrial label printer and it will not let me set zero margins nor let me
> make sure the text lines are x far apart to fit in constricted space. 
> 
> As it is not I have to print the Document as a PDF form and let people fill
> out what they need by hand before printing out. 
> 
> Not ideal.

Well, in the past I used to print product labels on a single wide label printer for ceramics shipment. In that case it also had an image for scanning and text, what I did is used a base form, which is just a writer file and laid it up in print view. Feed the form from a query with results for the print run, walked down the result set, while print the form for each record. Sounds close to what you want to do.
Comment 9 debug@roosoft.ltd.uk 2018-08-12 10:34:03 UTC
(In reply to Drew Jensen from comment #8)
> (In reply to debug@roosoft.ltd.uk from comment #7)
> > > Debug: are you happy with this answer?
> > 
> > Not especially. Base reports don't allow page size restrictions in the same
> > way that Documents does. That is to say I am trying to print out on an
> > industrial label printer and it will not let me set zero margins nor let me
> > make sure the text lines are x far apart to fit in constricted space. 
> > 
> > As it is not I have to print the Document as a PDF form and let people fill
> > out what they need by hand before printing out. 
> > 
> > Not ideal.
> 
> Well, in the past I used to print product labels on a single wide label
> printer for ceramics shipment. In that case it also had an image for
> scanning and text, what I did is used a base form, which is just a writer
> file and laid it up in print view. Feed the form from a query with results
> for the print run, walked down the result set, while print the form for each
> record. Sounds close to what you want to do.

Broadly I suppose. Essentially we have products with different logos that must be attached to them. 

The labels are just the last part of an auditable printing system I am trying to write. This is because it is to do with food stuffs and so duplicate labels should not be printed unless authorised by someone signing off on that. You don't want today's labels being places on yesterdays good for example. 

I thought at first it would be pretty easy to just generate a preview in a LO Base form and then print it straight from there, flagging the print as it went. But like I say Base reports are not so easy to work with and trying to constrict them to a concise layout where everything had to be in the same place every time is frustrating to say the least. 

Maybe if I carry on trying to work on it I can eventually get a template to work but at this stage starting to look like a massively more complex problem and I might need to resign myself to using webforms and php and accessing the DB directly.
Comment 10 Drew Jensen 2018-08-12 12:16:11 UTC
> 
> Maybe if I carry on trying to work on it I can eventually get a template to
> work but at this stage starting to look like a massively more complex
> problem and I might need to resign myself to using webforms and php and
> accessing the DB directly.

Actually, I wouldn't mind helping you with this, and can post up an example of what I am talking about, but at this point the conversation should leave the bug tracker and move over ask.libreoffice.org site.

Would that work for you?
Comment 11 debug@roosoft.ltd.uk 2018-08-12 13:46:49 UTC
(In reply to Drew Jensen from comment #10)
> > 
> > Maybe if I carry on trying to work on it I can eventually get a template to
> > work but at this stage starting to look like a massively more complex
> > problem and I might need to resign myself to using webforms and php and
> > accessing the DB directly.
> 
> Actually, I wouldn't mind helping you with this, and can post up an example
> of what I am talking about, but at this point the conversation should leave
> the bug tracker and move over ask.libreoffice.org site.
> 
> Would that work for you?

Yeah I should really. But not sure I have time to write it all down as another post now. Already behind on a PBX I need to set up. 

Thanks.
Comment 12 Xisco Faulí 2018-08-15 14:26:04 UTC
@Drew Jensen, should it be closed as RESOLVED NOTABUG ?
Comment 13 Drew Jensen 2018-08-15 19:45:45 UTC
(In reply to Xisco Faulí from comment #12)
> @Drew Jensen, should it be closed as RESOLVED NOTABUG ?

I would think so.