I have a C# WPF application which interacts with SQL Server Database. In application I want user be able to export some kind of data from SQL to Excel. I’m trying firstly to fill a Datatable and then export it to excel file. Everything was fine, untill I faced up with a task to export a datatable filled with this sql query:
to a formatted excel file like this:

So how can I sort selldetails of every sell in one region in excel file?
It’s been a long time I’m puzzling my mind over this problem, please, help me!
In case if someone needs to solve a problem in analogy I achieved the goal with this piece of code: