sheet_add_json with origin: -1 leaves gap from bottom of worksheet
See original GitHub issueI’m seeing strange behavior with the following code:
const XLSX = require('xlsx');
const wb = XLSX.utils.book_new();
const ws = XLSX.utils.json_to_sheet([
{ Product: 'p2', Qty: 2 },
]);
XLSX.utils.sheet_add_json(ws,
[
{ Product: 'p3', Qty: 3 },
{ Product: 'p4', Qty: 4 },
{ Product: 'p5', Qty: 5 },
{ Product: 'p6', Qty: 6 },
{ Product: 'p7', Qty: 7 },
{ Product: 'p8', Qty: 8 },
],
{
header: ['Product', 'Qty'],
skipHeader: true,
origin: -1, // append to bottom of worksheet starting on first column
}
);
XLSX.utils.book_append_sheet(wb, ws, 'Bug sheet');
XLSX.writeFile(wb, 'bug.ods');
I expected p3
…p8
to be placed on rows 3 … 8, but they ended up on rows 6 … 11 (in LibreCalc at least).
I’m on 0.14.1. What might be going on?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:11 (9 by maintainers)
Top Results From Across the Web
Utility Functions - SheetJS Community Edition
aoa_to_sheet takes an array of arrays of JS values and returns a worksheet resembling the input data. Values are interpreted as follows: Numbers,...
Read more >while using header option with XLSX.utils.json_to_sheet ...
I am passing the same numbers of header titles. Here is my code const ws: XLSX.WorkSheet = XLSX.utils.json_to_sheet(json, {header: headerColumns}); ...
Read more >Origin: Data Analysis and Graphing Software - OriginLab
Origin's Graph toolbar lets you add layers to your graph, merge selected graphs, or extract data plots to separate layers or layers to...
Read more >Origin 2018 Features - OriginLab Wiki - Confluence
1.XYZ column. support in both using existing xyz datasets or import from files. 2. Use existing worksheets. support using any sheet from opj ......
Read more >xlsx - npm
SheetJS Spreadsheet data parser and writer. ... functions for translating JSON Arrays and other common JS structures into worksheet objects.
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
Greetings from 2021 ❗
Here’s a 2020 ping!