Is it possible to have custom column on json_to_sheet? #771
Labels
No Label
DBF
Dates
Defined Names
Features
Formula
HTML
Images
Infrastructure
Integration
International
ODS
Operations
Performance
PivotTables
Pro
Protection
Read Bug
SSF
SYLK
Style
Write Bug
good first issue
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sheetjs/sheetjs#771
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I want to add custom columns and not use the default object column name. Is this possible to do it?
If you want to change the order, set the
header
option to an array of the keys:The keys are written to the first row of the resulting worksheet, so if the order is correct you can set the first row values. For example, to rename the first column to be "ABC":
Just noticed the documentation does not describe the options, will update shortly.
When I do this I get the following error
var ws = XLSX.utils.json_to_sheet(data, {header:['def','abc']});
ERROR in C:/myapp/angular/src/app/topics-view/topics-view.component.ts (590,64): Argument of type '{ header: string[]
; }' is not assignable to parameter of type 'JSON2SheetOpts'.
Object literal may only specify known properties, and 'header' does not exist in type 'JSON2SheetOpts'
The type definition is missing, it will show up in the next update
Hi all,
How I can get data in the following format
Employee Details
Emp Name Emp Sal
xyz 1000
abc 2000
Any help would be appreciated.
I also want to know how to format the above data @rajuyadav-orchestratec