excel-reader
v1.0.8
Published
This is an angular module compatible with angular 6+ versions. It reads excel files, validate it, and show it in a tabular format.
Downloads
55
Readme
#Excel-reader This is an angular module compatible with angular 6+ versions. It reads excel files, validate it, and show it in a tabular format.
#DEMO https://stackblitz.com/edit/angular-5dwch5
##Dependencies 1."xlsx":0.10.0 2."material-design-lite":^1.3.0
##Installation
Run the command npm i excel-reader
In your app.module.ts
import the module as
import {ExcelReaderModule} from "excel-reader"
Add the module to the import section
imports: [
BrowserModule,
ExcelReaderModule
.....
],
In your app.html
put the code given below
<lib-excel-reader [xlConfig]="configXl"></lib-excel-reader>
Finally in your app.component.ts
file add the configuration you want
this.configXl =
{
startingRow: 0,
validation: [{
fieldName: "work email",
validationType: "email"
},
{
fieldName: "personal email",
validationType: "email"
},
{
fieldName: "home phone",
validationType: "number",
length: 10
}],
showAll: true
};
##Configuration Properties
- startingRow holds the row number from which your excel sheet starts ( Not the headers and all)
- fieldName is the name the header field in your excel sheet you want to validate
- validationType is the type of validation you want to apply in the particular field of your excel-sheet
- if showAll is set to true it will display all the data in the excel sheet otherwise it will only show the rows having errors. Thats all, now you can run your application and test it.