forked from exceljs/exceljs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request exceljs#320 from psellers89/master
Add printTitlesRow Support
- Loading branch information
Showing
3 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
var Excel = require('../excel'); | ||
|
||
var filename = process.argv[2]; | ||
|
||
var wb = new Excel.Workbook(); | ||
|
||
var ws = wb.addWorksheet('printHeader'); | ||
|
||
|
||
ws.getCell('A1').value = 'This is a header row repeated on every printed page'; | ||
ws.getCell('B2').value = 'This is a header row too'; | ||
|
||
for (var i=0 ; i < 100 ; i++){ | ||
ws.addRow(['not header row']); | ||
}; | ||
|
||
|
||
ws.pageSetup.printTitlesRow = '1:2'; | ||
|
||
|
||
wb.xlsx.writeFile(filename) | ||
.then(function() { | ||
console.log('Done.'); | ||
}) | ||
.catch(function(error) { | ||
console.log(error.message); | ||
}); |