Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add more than one header? #229

Open
mkarrfan opened this issue Jun 13, 2018 · 2 comments
Open

How to add more than one header? #229

mkarrfan opened this issue Jun 13, 2018 · 2 comments

Comments

@mkarrfan
Copy link

Please refer attachment.

2Headers.xlsx

@dekhosla
Copy link

dekhosla commented Mar 4, 2019

Its easy
HTML

button type="button" ng-csv="exportArray()" filename="Reports_CSV.csv" csv-main="headerFirstExport" csv-header="headerExport">export</button

Javascript

$scope.exportArray = function () {   
    return $scope.data;
}  $scope.headerFirstExport=['CSV-header 1 -   Column A','CSV-header 1- Column B','CSV-header 1 - Column C']; 
$scope.headerExport = ['CSV-header 2 -   Column A','CSV-header 2 - Column B','CSV-header 2 - Column C'];

Library for ng-csv is attached below

ng-csv.txt

@anjalih28
Copy link

@dekhosla Hi I am trying to add two headers too.
But csv-main does not seem to work for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants