> For the complete documentation index, see [llms.txt](https://docs.xorosoft.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xorosoft.com/xoroerp-1/reports/sales/gross-margin-report.md).

# Gross Margin Report

### What is a Gross Margin Report?

The Gross Margin Report provides a detailed analysis of sales performance and profitability by comparing sales revenue with the cost of goods sold (COGS). It enables businesses to evaluate gross profit and gross margin across different items, stores, brands, categories, and other dimensions over a selected period.

Using this report, users can identify profitable and low-margin products, analyze sales trends, compare performance across locations, and make informed pricing and inventory decisions. The report can also be customized by rearranging fields, applying filters, and displaying the data in different layouts to suit reporting requirements.

### Running and Customizing the Gross Margin Report

To access and work with the Gross Margin Report in XoroERP, follow these steps:

1. Navigate to **Menu > Reports > Sales > Gross Margin Report**.
2. The report opens in **Grid** view by default.
3. Select the required filters from the top of the report.
4. Click the **Refresh** icon in the top-right corner to load the report based on the selected criteria.
5. Use the toolbar to customize, export, or change the report layout as required.

<figure><img src="/files/v9BhNsXp0qETTkxGaGLJ" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/Jc0kl4XJdraa0OPiKyAM" alt=""><figcaption></figcaption></figure>

### Report Filters

The report provides several filters that allow users to analyze gross margin data based on specific business requirements.

* **Period:** Filters the report using a predefined period or a custom date range.
* **Sale Store:** Filters the report for a specific sales store.
* **Item or Desc:** Allows users to search using the item number or item description.
* **Brand:** Filters the report by product brand.
* **Category:** Filters the report by item category.
* **Item Group:** Filters the report by item group.
* **Ref Number:** Filters the report using the transaction reference number.
* **Order Number:** Filters the report by sales order number.

<figure><img src="/files/BMDYFyTSWtkE8u1NyqFO" alt=""><figcaption></figcaption></figure>

After selecting the required filters, click the **Refresh** icon to apply the changes.

### Gross Margin Report Fields

The report displays sales and profitability metrics that help analyze business performance.

| **Field**                 | **Description**                                                                                    |
| ------------------------- | -------------------------------------------------------------------------------------------------- |
| Ship To Country           | Displays the destination country associated with the transaction.                                  |
| Transaction Date          | Displays the transaction date used for grouping and analysis.                                      |
| Item Number               | Displays the unique item number or SKU.                                                            |
| Sum of Sales              | Displays the total sales amount for the selected grouping.                                         |
| Sum of Cost of Goods Sold | Displays the total cost of goods sold (COGS).                                                      |
| Gross Margin              | Displays the profit amount calculated by subtracting the cost of goods sold from the sales amount. |
| Gross Margin %            | Displays the gross margin as a percentage of sales.                                                |

The report dynamically groups and summarizes these values based on the selected fields and layout.

### Drill-Down Functionality

Users can click any summarized value within the report to open the **Details** window.

The **Details** window displays the individual transactions that contribute to the selected summarized value, including information such as:

* Item Number
* Transaction Date
* Ship To Country
* Sales
* Cost of Goods Sold

<figure><img src="/files/NK77bpDGCKHt0IsX8Hbd" alt=""><figcaption></figcaption></figure>

This allows users to drill down from summarized report data to the underlying transaction records for detailed analysis.

### Toolbar

The toolbar provides several options for managing, exporting, and customizing the report.

1. **File**

* **Save My Layout:** Saves the current report layout for future use.
* **Restore Layout:** Restores the previously saved report layout.
* **Restore Filters:** Removes all applied filters and restores the default filter settings.
* **Save as New:** Saves the current report configuration as a new report.

2. **Tools**

* **Expand All:** Expands all grouped data within the report.
* **Collapse All:** Collapses all expanded groups.
* **Fill Group Cells:** Repeats grouped values in blank cells for improved readability.
* **Hide Group Cells:** Hides repeated grouped values for a cleaner display.

3. **Export:**

Exports the report in supported formats for sharing or further analysis.

* **Grid:** Displays the report in a tabular format.
* **Charts:** Display the report using graphical charts for easier analysis and visualization.

### Layout and Formatting Options

The **Format**, **Options**, and **Fields** buttons allow users to customize the appearance and structure of the report.

#### Format

The **Format** window allows users to customize how report values are displayed. Users can modify text alignment, configure thousands and decimal separators, define currency symbols and formatting, display custom values for null fields, and choose whether values are shown as percentages.

The window also supports conditional formatting, allowing multiple formatting rules to be applied to highlight important report data.

#### Options

The **Options** window allows users to configure how the report is displayed.

Available options include:

**Grand Totals:** Configure how grand totals are displayed:

* Do not show grand totals
* Show grand totals
* Show for rows only
* Show for columns only

**Subtotals:** Control how subtotals appear within grouped data:

* Do not show subtotals
* Show subtotals
* Show subtotal rows only
* Show subtotal columns only

**Layout:** Choose the report layout:

* Compact Form
* Classic Form
* Flat Form

After making the required changes, click **Apply** to update the report.

<figure><img src="/files/zMKf43OHNvY7SYXeTKfW" alt=""><figcaption></figcaption></figure>

#### Fields

The **Fields** option allows users to customize how report data is organized.

Within this window, users can:

* Search for available fields.
* Select or clear fields using the checkboxes.
* Drag and drop fields between **Report Filters**, **Columns**, **Rows**, and **Values** to customize the report layout.
* Rearrange the order of selected fields.
* Add calculated values using the **Add Calculated Value** option.
* Click **Apply** to update the report with the selected configuration.

<figure><img src="/files/DvT5wmLq1ATDTQRzX79q" alt=""><figcaption></figcaption></figure>

The report provides a wide range of fields that can be used for analysis, including transaction details, customer information, item information, product categories, brands, stores, shipping information, quantities, sales values, cost values, gross margin metrics, dates, and other reporting dimensions.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.xorosoft.com/xoroerp-1/reports/sales/gross-margin-report.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
