How to set cell type?
See original GitHub issueGiven some data like:
const workbook = new Excel.Workbook();
const sheet = workbook.addWorksheet('My Sheet');
const rows = [
[1, 'Bob', true],
[2, 'Jake', false]
];
sheet.addRows(rows);
How can I make the sheet column types in the excel file end up being Excel.ValueType.Number, Excel.ValueType.String, Excel.ValueType.ValueType.Boolean?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:11
- Comments:6
Top Results From Across the Web
using poi , How to set the Cell type as number
i.e. In the newly create excel , when I right click and go to format cell ->there I always found number to be...
Read more >Apache POI Excel Cell Type
To set various types of values in cell, Apache POI provides overloading function setCellValue() which allows us to set values as per the...
Read more >Setting Cell Type in Excel 2010
Right Click on the cell » Format cells » Number. Click on the Ribbon from the ribbon. Set Cell Type. Various Cell Formats....
Read more >Cell (POI API Documentation) - Apache POI
Set the cells type (blank, numeric, boolean, error or string). If the cell currently contains a value, the value will be converted to...
Read more >Set a Cell Format as Text in Excel
Open the Excel workbook · Click on the column heading to select entire column · Click Format > Cells · Click the Number...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Is there any update on this? It will be very useful for cases where number is being stored as string or when date timezone needs to be changed on server side.
you can change the cell’s format by the following code (in this example I change all cells in col 1 (A) to text format:
const cell = worksheet.getColumn(1); cell.eachCell((c, rowNumber) => { c.numFmt = '@'; });