How to Sort Detail General Ledger by Account Code

How to Sort Detail General Ledger by Account Code

I need to send a detail general ledger to our tax preparer. I have customized the report to show the account code column. However, when I click the column to sort by it, it doesn't work.  The report is not organized in balance sheet/income statement order (or any other order that I can identify).

How do I fix this?