Generate multiple card forms
Example
Some data of the employee information table employee.xlsx is shown in the figure below:
The task is to use these data to generate a card form for each employee, as shown in the figure below. The empty card file name is card.xlsx:
The SPL script is:
A |
B |
C |
|
1 |
=T("E:/work/employee.xlsx") |
[C1,C2,F2,C3,C4,D5,C7,C8] |
|
2 |
for A1 |
=file("E:/work/card.xlsx").xlsopen() |
|
3 |
for C1 |
=B2.xlscell(B3,1;A2.field(#)) |
|
4 |
=file("E:/work/"+A2.Name+".xlsx").xlswrite(B2) |
A1 Import the data of the employee information table.
C1 Define the sequence of cell names where each file of the employee information is about to be written on the card.
A2 Loop through every employee.
B2 Open the empty card file as an Excel object.
B3 Loop through each cell to be filled in.
C3 Fill the content of the corresponding field number in the current employee A2 into the current to-be-written cell.
B4 Store the Excel object of B2 to the Excel file named after the employee's name.
SPL Official Website 👉 https://www.scudata.com
SPL Feedback and Help 👉 https://www.reddit.com/r/esProc_Desktop/
SPL Learning Material 👉 https://c.scudata.com
Discord 👉 https://discord.gg/cFTcUNs7
Youtube 👉 https://www.youtube.com/@esProcDesktop
Linkedin Group 👉 https://www.linkedin.com/groups/14419406/