Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion - support right-to-left sheets #81

Open
doronsolomon opened this issue Dec 6, 2022 · 4 comments
Open

Suggestion - support right-to-left sheets #81

doronsolomon opened this issue Dec 6, 2022 · 4 comments

Comments

@doronsolomon
Copy link

Hi,
Thanks for your great library.
I would love to see support in sheets to be right to left for languages that are right to left.
Thanlks

@shuchkin

This comment was marked as outdated.

Repository owner deleted a comment from ghalysaqqal Dec 24, 2022
@shuchkin shuchkin changed the title Suggestion - support rlt sheets Suggestion - support right-to-left sheets Dec 24, 2022
@vol4ikman
Copy link

Hello. Do you planning to support RTL sheets?

Thanks

@shuchkin
Copy link
Owner

Hello. Do you planning to support RTL sheets?

Thanks

RTL mode added in 1.3.13

$data = [
    [ 1, 2, 3],
    [ 4, 5, 6]
];
SimpleXLSXGen::fromArray($data)
    ->rightToLeft()
    ->saveAs('test_rtl.xlsx');

@xaviermdq
Copy link
Contributor

Hi Sergey:
I think there is a logic problem in _sheetToXML method. Initializing $SHEETVIEWS and $AC before the IF block its Ok, if we terminate the $SHEETVIEWS string after the IF block. I think it should be:

        # code
        $SHEETVIEWS = '<sheetViews><sheetView tabSelected="1" workbookViewId="0"' . ($this->rtl ? ' rightToLeft="1"' : '') . '>';
        $AC = 'A1'; // Active Cell
        if (count($this->sheets[$idx]['rows'])) {
            # code
        } else {
            $ROWS[] = '<row r="1"><c r="A1" t="s"><v>0</v></c></row>';
            $REF = 'A1:A1';
        }
        $SHEETVIEWS .= '<selection activeCell="' . $AC . '" sqref="' . $AC . '"/>';
        $SHEETVIEWS .= '</sheetView></sheetViews>';
        # code

What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants