Howto get the selected Records in the mail merge Document in

Discuss the word processor

Howto get the selected Records in the mail merge Document in

Postby wbr-de » Mon Jun 15, 2015 1:02 pm

Hi,

i have searched for a solution to my Problem in the OpenOffice Forum and various online Books, but i could not resolve it yet :-(


I have a mail merge Document, filled with Data in a BASE table. All works as expected.

Now my Problem:

when the mail merge Document Dialogbox is opened, the End User can select a few records or all of them.
I need the Information which records are selected to print, because after Printing i want to update the BaseTable to mark this records are printed! (printed=yes)

Can someone help me out ?

regards,
Wolfgang
OpenOffice 3.4.1 on Windows 7
wbr-de
 
Posts: 3
Joined: Mon Jun 15, 2015 12:35 pm

Re: Howto get the selected Records in the mail merge Documen

Postby Villeroy » Tue Jun 16, 2015 5:17 pm

This is a tricky problem without built-in feature that could help to solve this problem.
A) Without any changes to the database structure, you could use a simple query which shows the latest items on top so it is easier to find and select the items that have not been added recently but not printed yet.
B) You may add a boolean field, let the user check the records to be printed, then print the checked records only and let a macro reset all check boxes after printing. The boolean field starts with a null value, then it can be set to True (checked) and after the print out a macro resets them to False. So you can always distinguish which ones have been printed, which ones are about to be printed and which ones wait to be queued.
There is an "Access2Base" macro suite which might include some Basic code able to execute a simple SQL statement such as
Code: Select all   Expand viewCollapse view
UPDATE "Table" SET "Check"=False WHERE "Check"=True;

That code can to be triggered by the event which is labeled "printing of form letters finished" in dialog menu:Tools>Customize... tab [Events]
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, no OpenOffice, LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 26875
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Howto get the selected Records in the mail merge Documen

Postby wbr-de » Thu Jun 18, 2015 9:56 pm

Hi,

this is what i have realized and it worked as you described.

what i really wanted to know how to get the information about the selected records:

1. get the actual connection parameters
2. get the defined resultset to identify the records
3. update the table ....

i cannot find any detailed description about the api in relation the the internal mail merge process :-(

Any hint in the right direction?

regards,
Wolfgang
OpenOffice 3.4.1 on Windows 7
wbr-de
 
Posts: 3
Joined: Mon Jun 15, 2015 12:35 pm

Re: Howto get the selected Records in the mail merge Documen

Postby Villeroy » Thu Jun 18, 2015 10:41 pm

Forget this rotten API. It is incredible difficult and once you found what you need, you may find that it does not work.
No, I dont have any further suggestion.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, no OpenOffice, LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 26875
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Howto get the selected Records in the mail merge Documen

Postby Villeroy » Fri Jun 19, 2015 10:39 pm

The attached linked zip archive is a little database application with
-- a Read Me file
-- a Base document as configuration file
-- a database driver hsqldb.jar (HSQL 2.3)
-- a database backend (4 files in a folder)
-- and a database frontend consisting of a serial letter template, an input form and a reporting spreadsheet.

The part which is directly related to your question is the letter template containing a macro which is triggered by document event “Printing of form letter finished” (see Tools>Customize...).

The OutputX.odt files are my test results from printing serial letters to documents.

All you need is some trusted macro directory where you extract the archive.
Open the database document, wait for a success message, save, close, forget the database document.
Open the ReadMe file and start from there.

Once the database has installed itself, the frontend files can be moved or accessed through desktop links. Since they refer to the registered database name, they always find their database.
The only macro which is required for the installed demo is the one in the letter template.
The report is a most simple spreadsheet but this report type is easily adjustable, filterable, sortable, formattable in place by end users.

Advantage of the form document:
-- The input form lets you pick database records to be printed much easier than selecting records on a grid view. You can select records, do something else, collect more records later and print all records at the end of the day.
-- It avoids duplicates because already printed records are not selectable and not storable.
-- You keep track of what had been printed when.

The advantages of external HSQL database over embedded ones have been discussed frequently on this forum. The type of database has nothing to do with this topic.
However, I used this PrintLog application as another test case for my FreeHSQLDB extension which helps to convert embedded into stand-alone database and to build portable, self-installing database packages.
FreeHSQLDB v.0.3 (todays bugfix release 0.3.2).
Please let me know if the database installs properly on your system.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, no OpenOffice, LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 26875
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Howto get the selected Records in the mail merge Documen

Postby wbr-de » Tue Jun 23, 2015 6:20 pm

Hi,

thanks for your complete Example, i will give it a try in the next week !

regards
Wolfgang
OpenOffice 3.4.1 on Windows 7
wbr-de
 
Posts: 3
Joined: Mon Jun 15, 2015 12:35 pm


Return to Writer

Who is online

Users browsing this forum: No registered users and 35 guests