How to set `rightToLeft: true` to the excel document by default
How to set `rightToLeft: true` to the excel document by default
sadeghbarati
Posts: 14Questions: 4Answers: 0
I have the same question as this discussion topic, which is unanswered
When I export Excel files with DataTable Buttons I have reversed column which the user needs to go to the Page Layout
tab and manually click on the Sheet Right-to-Left
button
var sheet = xlsx.xl.worksheets['sheet1.xml'];
// 1.
$('sheet', sheet).attr('rightToLeft', 'true');
// 2.
$('worksheet', sheet).prepend('<sheetViews><sheetView rightToLeft="1"></sheetView></sheetViews>')
I tested both of these codes I found on the web but it not working,
This question has an accepted answers - jump to answer
Answers
I think you'll need a right to left file produced by Excel, and then rename it to a zip file and extract it. Then check what XML Excel has created and see if you can replicate that for the downloaded spreadsheet.
The Buttons Excel exporter is not intended to be used for anything other than trivial spreadsheets I'm afraid.
Allan
You are right Allan it is intended but I want to set rightToLeft by default
even though I did the same thing to find XML rightToLeft code, I found those codes above which make Excel file open with XML error
I got it working with this
without
workbookViewId
Excel will open with XML error but when it exists, rightToLeft is workingVery good - thank you for sharing this with us!
Allan