Please enable JavaScript to view this site.

The following example shows you how to compose a series letter that can be sent to all employees of the company with an overview of their used leave hours.

Perform the following steps:

Start Microsoft Word.

Log in to Invantive Composition as described in Connect.

Make a new file, for example on the basis of the prescribed layout for letters within the company. The end result might be for example:

Empty letter ready to be supplied with data from database

Set the fixed texst in the letter. In this example we assume that we are giving an employee an overview of his recorded leave hours of the last year.

Be careful not to use any unnecessary line breaks or any double spaces. Use styles.

The final template without information from the database is:

Example of a letter with used leave hours without the prefilled information

Click on 'Install Database' in the Modeller ribbon. This changes the document in a template for Invantive Composition.

With the button 'Design Modus' you shift between being able to edit or not being able to edit the model using 'Edit Model'.

Click on 'Edit Model' and adjust the model as follows:

Edit model for the document

You wish to be able to print out the letter just for one specific employee which you enter at the start.

That is why you need to enter a parameter as follows in the model:

Parameter for entered name employee for the leave letter.

Then finally choose 'Save' and close the model editor.

You can now leave the design modus by clicking on the button 'Design Modus' one more time.

Next we will add instructions to add data to the letter when the template is opened.

Be careful: Microsoft Word, depending on your settings, changes the straight double quote (") in open or close quotes. If this happens, press Ctrl+Z (undo) immediately; you will then regain the originally entered straight double quote.

We will now add the following query lines and parameters to the document. With these rules Invantive Composition will allow you to automatically fill your document with dynamic texts:

Foreach query rule:

To ensure that the same information layout returns on every document, we add the query line "foreach". This indicates that you want the same information to be applied on every document with the same layout. Within the "foreach" query line you enter all information that you wish to have on the employee. The "foreach" query line looks like this:

<invantive:foreach query="select gbr_voornaam || case when gbr_tussenvoegsel is not null then ' ' || gbr_tussenvoegsel end || ' ' || gbr_achternaam gbr_volledige_naam, case when gbr_geslacht_ind='M' then 'heer' else 'mevrouw' end gbr_aanhef_geslacht, gbr_adres_regel_1, gbr_postcode, gbr_plaats, gbr_land, to_char(sysdate, 'dd-mm-yyyy') vandaag, lvr_naam, gbr_baas_functie, gbr_baas_naam, to_char(add_months(sysdate, -6) , 'dd-mm-yyyy') || '-' || to_char(sysdate, 'dd-mm-yyyy') periode, gbr_id from bubs_gebruikers_v where gbr_naam like $P{p_naam_medewerker_patroon} || '%' and lvr_code = '13031406' and gbr_tijdschrijver_vlag = 'Y' order by gbr_naam ">

Now that we have entered the "foreach" query for the document, the different "parameters" for the dynamic filling of the letter need to be added. The first "parameter" that we add is the addressing. This is because this differs for each letter. To automatically add addressing by Invantive Compositions, you add the following "parameters" to the document:

<invantive:value-of expression="$F{gbr_volledige_naam}"/>

<invantive:value-of expression="$F{gbr_adres_regel_1}"/>

<invantive:value-of expression="$F{gbr_postcode}"/> <invantive:value-of expression="$F{gbr_plaats}"/>

<invantive:value-of expression="$F{gbr_land}"/>

The next step is the adding of the "parameters" for the salutation and content information of the serial letter. Here you are also dealing with dynamic texts. The "parameters" that you wish to add automatically you place between the continuous text of your document. The implementation then looks as follows:

 

Subject                      Recorded leave during the period <invantive:value-of expression="$F{periode}"/> by <invantive:value-of expression="$F{gbr_volledige_naam}"/>

Appendix(es)0
Our Reference<invantive:value-of expression="$P{p_referentie}"/>
DateHarderwijk, <invantive:value-of expression="$F{vandaag}"/>

 

Now that we have added the "parameters" for the salutation we continue with the remainder of the serial letter. The next "parameters" that we add are part of the core of the serial letter. With these "parameters you ensure the proper mention of the personal data within the letter. By adding the following "parameters" within the ongoing text you allow Invantive Composition to automatically fill the text.

Dear <invantive:value-of expression="$F{gbr_aanhef_geslacht}"/> <invantive:value-of expression="$F{gbr_volledige_naam}"/>,

For your work activities within <invantive:value-of expression="$F{lvr_naam}"/> you accrue leave entitlement. If you make use of leave time then this will be at the expense of accrued leave hours. With this letter we present you with an overview of the recored leave hours in the recent six months.

Now that the dynamic texts are automatically added within the serial letter, we add the "parameters" for the leave hours. Because you want to have the same layout for each letter, you again add a "foreach" query line. With this query you retrieve all leave hours from the database and process these by Invantive Composition in the text. The query then looks as follows:

<invantive:foreach query="select to_char(uur_uren_inspanning, 'FM90D00') uur_uren_inspanning_c, to_char(uur_datum_start, 'dd-mm-yyyy') uur_datum_start_c, uur_commentaar from bubs_uren_v where gbr_id = $F{gbr_id}  and pjt_code like 'IVAC%' and uur_datum_start > add_months(sysdate, -6) order by uur_datum_start">

     <invantive:value-of expression="$F{uur_datum_start_c}"/>: <invantive:value-of expression="$F{uur_uren_inspanning_c}"/> uur</invantive:foreach>

 

Now that the leave hours are automatically entered, we close the serial letter with the sender. Here we also make use of "parameters" to automatically fill in the name and function of the sender. We enter the following "parameters":

 

<invantive:value-of expression="$F{gbr_baas_naam}"/>

<invantive:value-of expression="$F{gbr_baas_functie}"/>

 

Now that all "parameters" have been added, we close the document with the following line:

</invantive:foreach>

 

The template for the requesting of the leave hours is now finished and looks as follows:

voorbeeld-verlofuren-seriebrief-model.docx

Now save the template. For this example I will save the template as "voorbeeld-verlofuren-seriebrief" in Word.

Now the model is saved Invantive Composition will allow you to publish this with a single click. By publishing the template Invantive Composition will retrieve the data from your database and the "parameters" will automatically be filled.

To request the leave hours of an employee you will proceed as follows.

Click on "Publish" and let Invantive Composition use the template to fetch the recorded leave.

Now you see a window appear with "parameters". You will see here the "parameters" name employee and reference letter. This is currently on the setting "wildcard" which means that Invantice Composition does not add reference (this is different per letter) and requests all leave hours of the employees.

Publish-verlofuren-aanvragen-naam-wildard

To request the leave per employee, replace the "%" in "value" for the name of the employee. Do you want a reference? Fill these in as well then. Subsequently, click on "ok" to publish the model.

voorbeeld-verlofuren-seriebrief-opgevraagde-uren-naam.docx

Invantive Composition now asks you under which name and on which disc you want to save the document. Choose a name and drive and save the document.

Now open the document with the requested leave hours. Your document will look as follows:

voorbeeld-verlofuren-seriebrief-opgevraagde-uren.docx