securedeveloper / react-data-export

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

Style on <ExcelColumn> while using "data" not "dataSet" on <ExcelSheet> #113

Open lexrom opened 5 years ago

lexrom commented 5 years ago

First of all, thanks for your great job, I love your data export!

My question: How do I set a style on "label" and "value" while using an <ExcelColumn> which is embraced by <ExcelSheet> while using "data", not a "dataSet"?

I know how to style headers and cells while using a "dataSet", you describe it here very well here: https://github.com/securedeveloper/react-data-export/blob/master/examples/styled_excel_sheet.md

But what I have is:

 <ExcelFile 
          element={<button className="btn btn-primary">Download as excel</button>} 
          filename="Excel" >
          <ExcelSheet data={filteredRows} name="Sheet1"> 
              <ExcelColumn label="id" value="id" /> 
              <ExcelColumn label="Firstname" value="firstname" /> 
              <ExcelColumn label="Surname" value="name" />
          </ExcelSheet>
 </ExcelFile>

So, how do I set styles on "label" and "value"? I have tried this (see below), but it doesn't work:

 <ExcelFile 
          element={<button className="btn btn-primary">Download as excel</button>} 
          filename="Excel" >
          <ExcelSheet data={filteredRows} name="Sheet1"> 
                <ExcelColumn label="id" value="id"  style={{font: {size: 24, bold: true}}}/> 
                <ExcelColumn label="Firstname" value="firstname"  style={{fontSize:20}}/> 
                <ExcelColumn label="Surname" value="name" width="50"/>
          </ExcelSheet>
 </ExcelFile>

Am I missing something or is this just not possible (yet)?

glssravya commented 4 years ago

I too have the same issue.can we add style attribute to ExcelColumn?

GaurravsIN commented 4 years ago

Any update on this issue?

mukeshbhargavan commented 4 years ago

Hi Team, I am also facing the same issue. Is there any update on this?

Sindhuja-developer commented 2 years ago

I am also having this issue. any solution for this?

vishal1785 commented 2 years ago

Same issue for me as well

meharfatimakhan commented 2 years ago

Same issue for me as well

lmarenast commented 2 years ago

I have the same problem