react-data-export
react-data-export copied to clipboard
Question: How to set right to left reading order?
Just a question, cannot figure out how to set right to left <ExcelSheet> column order in a sheet?
<ExcelFile element={<button>Download Data</button>}>
<ExcelSheet data={dataSet1} name="לשונית ראשונה" horizontal={"right"} >
<ExcelColumn label="שדה 1" value="name"/>
<ExcelColumn label="שדה 2" value="amount"/>
<ExcelColumn label="שדה 3" value="sex"/>
<ExcelColumn label="הרבה מילים"
value={(col) => col.is_married ? "Married" : "Single"}/>
</ExcelSheet>
<ExcelSheet data={dataSet2} name="לשונית שניה" readingOrder={{horizontal:"right"}}>
<ExcelColumn label="כאן יהיו" value="name"/>
<ExcelColumn label="עוד הרבה" value="total"/>
<ExcelColumn label="נתונים" value="remaining"/>
</ExcelSheet>
</ExcelFile>
Use "Excel Export with Dataset", then in style set
alignment: {wrapText: true, horizontal: 'center', vertical: 'top'}.
For example:
[
columns: [{…}],
data:[
[{
value: 'Text',
style: {
font: { sz: '12' },
alignment: {readingOrder:2 wrapText: true, horizontal: 'center', vertical: 'top' },
border: { bottom: { style: 'thin', color: { rgb: '000000' } }
}
}]
]
alignment: {readingOrder:2