Print data section
Top  Previous  Next


The print data section function prints a paper for each row in the [Data] section. Each paper is built from a text file template with text and variables, the variables are replaced with data from each row in the [Data] section. The most common use of this function is to print password sheets - papers with account name and password for the users.

The template is a clear text file saved with the filename specified in Printer.Template. Use the SetupBatcher editor or notepad to create a template. Use Data.PrintRow to print automatically from a script. To print manually - first click "Remove markers" - only [Data] section rows without markers will be printed, then click Action > Print data section.

Template variables

Variable
Meaning
%fontname=xxx%
Printer font
%fontsize=yyy%
Printer font size
%addleadingspaces=zzz%
Printer left margin
%line%
Current line number
%total%
Total number of lines to print
%time%
Current date and time
%colx%
Column x from the [Data] section
%expires%
Value from "Account.Expires" in [Settings]
%dateformat=format%
%expires% date format

·d Displays the day as a number without a leading zero (1-31).  
·dd Displays the day as a number with a leading zero (01-31).  
·ddd Displays the day as an abbreviation (Sun-Sat)  
·dddd Displays the day as a full name (Sunday-Saturday)  
·m Displays the month as a number without a leading zero (1-12).  
·mm Displays the month as a number with a leading zero (01-12).  
·mmm Displays the month as an abbreviation (Jan-Dec)  
·mmmm Displays the month as a full name (January-December)  
·yy Displays the year as a two-digit number (00-99).  
·yyyy Displays the year as a four-digit number (0000-9999)  


Printer template example

%fontname=Courier%
%fontsize=14%
%addleadingspaces=5%
(Page %line%/%total%, printed %time%)



>>>%col4%<<<

User name: %col5%
Password: %col6%
%dateformat=MMMM DD, YYYY%
Your account expires: %expires%


Instructions:
1) Memorize your username and password, then destroy this paper.
2) Never write your password down.
3) Don't let anyone else see your password.

By signing, I agree to follow the above instructions.

Date / Name


_____________________________________


Copy 1 - signed by the user and put in a safe.
Copy 2 - distributed to the user.


Script

.
.
Printer.template=MyTemplate.txt
Account.Expires=2004-03-04
[Settings_End]

[Machines_Begin]
\\EDU8      NT PDC
[Machines_End]

[Batch_Begin]
Data.Loop   
 AD.Account.Create %ADOUPath%,%AccountName%,%AccountName%,%Password%   
Data.Endloop   
[Batch_End]

[Data_Begin]
         Steve Smith   Inet1   a2f13a7e      
         Lisa Barnes   Inet2   c4ba3bc4      
         George Best   Inet3   2125e66d      
         Margaret McFeast   Inet4   a29fdbc2
.
.

Result