title: How to export from sql to a formatted excel
body: <p>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:<img src="https://i.stack.imgur.com/1zyeO.jpg" alt="enter image description here"></p>
  
  <p>to a formatted excel file like this:
  <img src="https://i.stack.imgur.com/CxKka.jpg" alt="report"></p>
  
  <p>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!</p>