- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
public void ExportOrderDetails()
{
char comma = ',';
StringBuilder sb = new StringBuilder();
string line = "";
line += "Order No" + comma;
line += "Customer" + comma;
line += "Order Date" + comma;
line += "Order Status" + comma;
line += "Subtotal" + comma;
line += "Tax Total" + comma;
line += "Shipping Cost" + comma;
line += "Shipping Method" + comma;
line += "Order Total" + comma;
line += "Payment Method" + comma;
line += "Total Quantity" + comma;
line += "Date Shipped" + comma;
line += "Tracking No" + comma;
line += "Order Currency Code" + comma;
line += "Exchange Rate" + comma;
line += "Billing First Name" + comma;
line += "Billing Last Name" + comma;
line += "Billing Company" + comma;
line += "Billing Address" + comma;
line += "Billing Address 2" + comma;
line += "Billing City" + comma;
line += "Billing Zip" + comma;
line += "Billing State Code" + comma;
line += "Billing Country ISO2" + comma;
line += "Billing Phone" + comma;
line += "Billing Phone 2" + comma;
line += "Billing Email" + comma;
line += "Shipping First Name" + comma;
line += "Shipping Last Name" + comma;
line += "Shipping Company" + comma;
line += "Shipping Address" + comma;
line += "Shipping Address 2" + comma;
line += "Shipping City" + comma;
line += "Shipping Zip" + comma;
line += "Shipping State Code" + comma;
line += "Shipping Country ISO2" + comma;
line += "Shipping Phone" + comma;
line += "Shipping Phone 2" + comma;
line += "Shipping Email" + comma;
line += "Combined Product Weight" + comma;
line += "Product Qty" + comma;
line += "Product SKU" + comma;
line += "Product Name" + comma;
line += "Product Variation Details" + comma;
line += "Product Unit Price" + comma;
line += "Product Unit Cost" + comma;
line += "Product Weight" + comma;
line += "Product Total Price" + comma;
line += "Product Total Cost" + comma;
sb.AppendLine(line.Remove(line.Length - 1));
Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader("Content-Disposition", "attachment; filename=orders-details-" + DateTime.Now.ToString("yyyy-MM-dd") + ".csv");
Response.ContentEncoding = Encoding.Default;
Response.Write(sb.ToString());
Response.End();
}