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 hide/exclude columns while exporting #5

Open
yaswanthkata opened this issue Feb 19, 2018 · 2 comments
Open

How to hide/exclude columns while exporting #5

yaswanthkata opened this issue Feb 19, 2018 · 2 comments

Comments

@yaswanthkata
Copy link

I don't want to include all the properties of an object while exporting.Could you please help me on how to exclude the required properties.

@adrianbenjuya
Copy link

Simply use the .map() function in javascript arrays before passing the objects to the export method, something like this:

const aux = json.map(el => ({ firstProperty: el.firstProperty, secondProperty: el.secondProperty })); this. exportAsExcelFile(aux, 'Test');

Imagine that the variable json contained an array with objects like:
{ firstProperty: any, secondProperty: any, thirdProperty: any }

Then the thirdProperty won't be printed in the Excel file

@yaswanthkata
Copy link
Author

Thanks @adrianbenjuya will try it

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

2 participants