Hello,
do i have to do 4 dimensional table?
No. You can probably use a 1-dimensional array of 2 entries (the number in a row) to store the payslip info. You could also define the print area to be another array of 2 entries. Please ignore my previous suggestion about the "counter to 4" - i didn't realize/recall that the payslips needed to be printed 2-up.
As i asked earlier, can you print 1 payslip successfully? Once you can print a payslip successfully, change the code to move the payslip info to the array instead of printing directly. Add code to check if both entries have payslip data and if they do, move the data from to the payslip array to the print array and print.
Once 2 sets of payslips have been printed, advance the paper to a new page.