Search code examples
javascriptnode.jsangularexcelexceljs

How to Repeat a Row on All Pages When Printing in Excel js- row to repat at top in exceljs


I want to use the following option, or something similar, in the Excel Js library enter image description here

This option repeats a row when printing on all pages.

I know it is possible to freeze a row in Excel Js but I want a row to be repeated on all pages when printing


Solution

  • The solution to this question is the following code:

    worksheet.pageSetup.printTitlesColumn = "1:1";
    

    You may want to place more rows on each page.

    for example for 3 row of top write this string for printTitlesColumn propperty:

    worksheet.pageSetup.printTitlesColumn = "1:3";