Print-to-file view
FollowYou can print to Microsoft Word or Acrobat PDF files using Microsoft Word’s mail merge mechanism. Below are the steps to perform a print-to-file.
Create a print view
Create a print view starting from the Employees table (see Create a view )
Name: Stampa.dipendente.in.pdf
Tagname: Stampa.dipendente.in.pdf
Add the following fields to the view:
- Photo
- Surname and Name
- Business Email
- Office Phone
- Any additional fields
Each view has a tagname visible by opening the Options section under Tagname. Likewise, each field has a tagname, visible by clicking the field icon under Tagname. (See also Field properties)
The tagnames of views and fields are essential for print-to-file.
Create a Word document to use as a template
Open a blank Word document.
You must delimit the section where you want to print the view fields with two special merge fields: TableStart: and TableEnd:, followed by the view’s tagname.
To insert a merge field in the Word document, proceed as follows:
- From the Insert menu select Quick Parts and then Field:
- In the window that appears, choose the MergeField field:
- As the field name, enter the field’s tagname or TableStart:/TableEnd: followed by the view’s tagname.
Example:
«TableStart:Stampa.dipendente.in.pdf»
Full name: «Employees.SurnameAndName»
Business email: «Employees.EmailBusiness»
Business mobile: «Employees.MobBusiness»
Office phone: «Employees.TelBusiness»
Current company: «Employees.CurrentCompany»
Hire date «Employees.data_assunzione»
«TableEnd:Stampa.dipendente.in.pdf»
Once you’ve saved the file on your computer, you need to upload it as the Output of the print view.
- Expand the Output section
- Upload the file in the Template file field
- Select the output format. You can choose Word, PDF or both (you can choose at download time)
- Save the view by clicking Save
From Actions > Print you will also find the template you uploaded among the available formats.
Multiple views or subviews
In print views you can insert, in addition to fields, subviews by selecting them from the SubView folder of each entity.
Subviews can also be used within Altamira’s print-to-file by inserting the start and end tags of the SubView inside the main view.
For example, if we insert a subview with the employee’s addresses into the view created earlier, a possible result could be:
«TableStart:Stampa.dipendente.in.pdf»
Full name: «Employees.SurnameAndName»
Business email: «Employees.EmailBusiness»
«TableStart:Stampa.indirizzi.dipendenti.pdf»
«Addresses.Address»:
«Addresses.City», «Addresses.Province», «Addresses.Country»
«TableEnd:Stampa.indirizzi.dipendenti.pdf»
Current company: «Employees.CurrentCompany»
Hire date «Employees.data_assunzione»
«TableEnd:Stampa.dipendente.in.pdf»
The subview Stampa.indirizzi.dipendenti.pdf is completely contained within the main view Stampa.dipendente.in.pdf.
If the employee has more than one address, each address is printed in the file before returning to print the fields of the main view.
Tables
Using the same principle as subviews, you can also use tables in the template file.
- Insert in the template a table with a single row and as many columns as the fields you want to print.
- To generate as many rows as there are items in the subview, place the subview’s start tag in the first cell of the row together with the first field’s tagname. In the last cell, insert the tagname of the last field followed by the subview’s end tag.
As follows:
«TableStart:Stampa.dipendente.in.pdf»
Full name: «Employees.SurnameAndName»
Business email: «Employees.EmailBusiness»
|
TableStart:Stampa.indirizzi.dipendenti.pdf» «Addresses.Address» |
«Addresses.City», «Addresses.Province» |
«Addresses.Country» «TableEnd:Stampa.indirizzi.dipendenti.pdf» |
«TableEnd:Stampa.dipendente.in.pdf»
Images
To insert images, prefix the field’s tagname with Image:
For example: «Image:Employees.PhotoAttachment»
Comments
0 comments
Please sign in to leave a comment.