Hi Lan,
You can use PrintTitleRows and PrintTitleColumns properties of the PageSetup class to designate row and column headers that you want to have repeated on all pages of your printed worksheet. Please refer the following code snippet that illustrates the above:
[C#]
//Set Print Title Rows. Repeat row 2
sheet.PageSetup.PrintTitleRows = "$A$2:$IV$2";
//Print Columns 1 to 3
sheet.PageSetup.PrintTitleColumns = "$A$1:$C$65536";
Please refer the following sample which implements the above said feature:
PrintTitleRows.zipKindly take a look at the sample above and let me know if you have any other questions.
Regards,
Melba