Sql ORDER BY on report view is not respected on print format even there is no order by column not selected. I think it is good to have this respected and only override when any of print format item is marked as order.
Pull request created
For quick testing I suggest below steps.
Open Unallocated Invoice report. It is already sorted by document no
Click customize button and remove sort order
Now this report is not sorted by DocumentNo
Go to report view and look on record named RV_C_Invoice NotAllocated.
Add DocumentNo in Sql ORDER By field
Cache reset and refresh Unallocated invoice report. This time it should be sorted by document number.