Newbie to js-xlsx - JSON to xlsx conversion with using angular #666
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#666
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?
Anyone can guide me how to convert json to xlsx with using angular?
Here is sample json format:
[ { "agentNo":"324234", "subName":"30, Jul 2013 09:24 AM", "Location":"Singapore", "memberName":42, "certNo": "2342234", "Gender":"Male", "dob":"1 may 1987" }, { "agentNo":"444443", "subName":"30, Jul 2013 09:24 AM", "Location":"Malaysia", "memberName":42, "certNo": "2342234", "Gender":"Male", "dob":"1 may 1987" }, { "agentNo":"2342234", "subName":"30, Jul 2013 09:24 AM", "Location":"India", "memberName":42, "certNo": "2342234", "Gender":"Male", "dob":"1 may 1987" } ]
Here is xlsx sample that need to be generated:
Thanks in advance
@samuelkavin see my answer to your comment on #610
@jomel, thank you for response. All done. Now, I stuck with settting up the title of the excel file which is Member Listing, Company Name and Report Date on A1, A2 and A3 cell. Any idea?
@martinnov92, is it possible insert custom 3 row before header? something like this:
Hello @samuelkavin I really don´t know this, sorry
I added an example on exporting a xlsx file from an array of jsons on Angular2/4:
https://github.com/bogdancar/xlsx-json-to-xlsx-demo-Angular2
@bogdancar your demo isnt avaialble
@indunilw Sorry, fixed the link.
@samuelkavin @jomel did you solve the custom header portion of the sheet, where you want common data for the table in a top section, is this possible? the memberListing portion in the OPs example
The new
sheet_add_json
function can add to an existing worksheet:To control the order of the fields, pass a header option to sheet_add_json:
And to rewrite the column headers, if the objects don't have the same name as the titles you want, go back and rewrite a new header array in the fourth row (index 3):
@SheetJSDev OMG! Amazing! This makes it SO much easier. Thank you!