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

Question: How to set right to left reading order?

Open Mulli opened this issue 3 years ago • 1 comments

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>

Mulli avatar Sep 06 '21 03:09 Mulli

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

clleker avatar Sep 18 '21 19:09 clleker