securedeveloper / react-data-export

Export dataset in react.
https://securedeveloper.github.io/react-data-export/
MIT License
179 stars 198 forks source link

Styling the download Button and changing text ? #15

Closed HachimDev closed 6 years ago

HachimDev commented 6 years ago

Is it possible to style the download button along with the text inside please ?

surndraraj3 commented 6 years ago

Hi @HachimDev have you got any solution for styling and modify the text

HachimDev commented 6 years ago

unfortunately not. I had to create a new component using xlsx and file-saver from scratch

securedeveloper commented 6 years ago

Sorry guys about the delay, Was busy with another library. You will have a solution by the end of this week.

abiodunsulaiman694 commented 6 years ago

I was able to style the button and the text. ExcelFile.js accepts 2 props that has default values: filename and element

The default props from the source code: ExcelFile.js are: ExcelFile.defaultProps = { filename: "Download.xlsx", element: _react2.default.createElement( "button", null, "Download" ) };

To override it, simply pass in your own props: <ExcelFile filename="Report Validation" element={(<Button bsStyle="info"> Download Report </Button>)}>

Please, note that, in my case, I already have, Button component imported. You can use your own component. react-bootstrap comes handy, if interested

surndraraj3 commented 6 years ago

@abiodunsulaiman694 Many thanks

securedeveloper commented 6 years ago

@surndraraj3 hopefully your issue is solved now, This week I am working on it, going to release a minor change to support multiple sheets in Excel file. Just found a lot of things to improve and in coming weeks you guys will have some good stuff 🍯

surndraraj3 commented 6 years ago

@abiodunsulaiman694 I have implemented multiple sheets in a single excel file here is the example, By using your libraray

{ this.state.masterDataDownload ? (this.state.masterDataDownload.map((values) => { console.log('values', values); return ( ); })) : '' }