[v11.1.37] Sorting in Report Ordered Items to be Delivered

ERPNext: v11.1.37 (master)
Frappe Framework: v11.1.34 (master)

Is there a way to sort the items in the report like they are ordered in the sales order?

Somehow they are ordered in a different way and I don’t know how to sort them.

Sorting in Sales Order:


Sorting in the report:


I just found the solution. There is a column in the table tabSales Order Item called idx which can be used to get the item ordering of the sales order.