react-data-export icon indicating copy to clipboard operation
react-data-export copied to clipboard

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

Open lexrom opened this issue 6 years ago • 7 comments

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)?

lexrom avatar Aug 16 '19 17:08 lexrom

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

glssravya avatar May 11 '20 15:05 glssravya

Any update on this issue?

GaurravsIN avatar Jul 24 '20 09:07 GaurravsIN

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

mukeshbhargavan avatar Aug 13 '20 18:08 mukeshbhargavan

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

Sindhuja-developer avatar Nov 02 '21 05:11 Sindhuja-developer

Same issue for me as well

vishal1785 avatar Dec 02 '21 18:12 vishal1785

Same issue for me as well

meharfatimakhan avatar Jan 31 '22 11:01 meharfatimakhan

I have the same problem

lmarenast avatar Apr 08 '22 19:04 lmarenast