---
schema_version: "1"
id: cf405fb57436c34a4eaeefd91065546698c25c083c56469c7f6f2fd69f46a7f4
title: ReportType
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_meta/meta_reporttype.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_reporttype.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: cebb7bdc29a60dd0b86fcd997a8c6c1c1f6c41a8e5767b0b6c6549403788f05c
description: Represents the metadata associated with a custom report type. Custom report types allow you to build a framework from which users can create and customize reports.
---
# ReportType

Represents the metadata associated with a custom report type. Custom report types allow you to build a framework from which users can create and customize reports.

![Important](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/images/icon_note_important.png)

#### Important

Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain terms to avoid any effect on customer implementations.

This type extends the [Metadata](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/metadata.htm "The base class for all metadata types. You can’t edit this object. A component is an instance of a metadata type.") metadata type and inherits its fullName field.

Redeploying a report type with the same fullName as a previously deleted report type via Metadata API restores the deleted report type instead of creating a new one, even if the report type was removed from the Recycle Bin. The restored report type keeps its original Id, CreatedDate, and CreatedById.

## Declarative Metadata File Suffix and Directory Location

The file suffix is .reportType for the custom report type definition. There’s one file per custom report type. Report types are stored in the reportTypes directory of the corresponding package directory.

## Version

Custom report types are available in API version 14.0 and later.

## Fields

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d824651e120">Field Name</th>

              <th class="featureTableHeader  " id="d824651e123">Field Type</th>

              <th class="featureTableHeader  " id="d824651e126">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d824651e120" data-title="Field Name"><span class="keyword parmname">autogenerated</span></td>

              <td class="entry" headers="d824651e123" data-title="Field Type">boolean</td>

              <td class="entry" headers="d824651e126" data-title="Description">
                <span class="ph" id="autogenerated_desc"><a name="autogenerated_desc"><!-- --></a>Indicates that the report type was
                  automatically generated when historical trending was enabled for
                  an entity.</span>
                <p class="p">Available in API version 29 and
                  later.</p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d824651e120" data-title="Field Name"><span class="keyword parmname" id="field_baseObject"><a name="field_baseObject"><!-- --></a>baseObject</span></td>

              <td class="entry" headers="d824651e123" data-title="Field Type">string</td>

              <td class="entry" headers="d824651e126" data-title="Description">Required. The primary object for the custom report type, for
                example, Account. All objects, including custom and external
                objects, are supported. You can’t edit this field after initial
                creation.<p class="p">Support for external objects is available in API
                  version 38.0 and later.</p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d824651e120" data-title="Field Name"><span class="keyword parmname">category</span></td>

              <td class="entry" headers="d824651e123" data-title="Field Type">ReportTypeCategory (<a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_objects_intro.htm#enumeration_title">enumeration</a> of type string)</td>

              <td class="entry" headers="d824651e126" data-title="Description">This field controls the category for the report. The valid values are:<ul class="ul bulletList">
                  <li class="li"><samp class="codeph nolang">accounts</samp></li>

                  <li class="li"><samp class="codeph nolang">opportunities</samp></li>

                  <li class="li"><samp class="codeph nolang">forecasts</samp></li>

                  <li class="li"><samp class="codeph nolang">cases</samp></li>

                  <li class="li"><samp class="codeph nolang">leads</samp></li>

                  <li class="li"><samp class="codeph nolang">campaigns</samp></li>

                  <li class="li"><samp class="codeph nolang">activities</samp></li>

                  <li class="li"><samp class="codeph nolang">busop</samp></li>

                  <li class="li"><samp class="codeph nolang">products</samp></li>

                  <li class="li"><samp class="codeph nolang">admin</samp></li>

                  <li class="li"><samp class="codeph nolang">territory</samp></li>

                  <li class="li">
                    <samp class="codeph nolang">territory2</samp> (This value
                    is available in API version 31.0 and later.)
                  </li>

                  <li class="li"><samp class="codeph nolang">usage_entitlement</samp></li>

                  <li class="li">
                    <samp class="codeph nolang">wdc</samp> (This value is
                    available in API version 29.0 and later.)
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">calibration</samp> (This value
                    is available in API version 29.0 and later.)
                  </li>

                  <li class="li"><samp class="codeph nolang">other</samp></li>

                  <li class="li"><samp class="codeph nolang">content</samp></li>

                  <li class="li"><samp class="codeph nolang">quotes</samp></li>

                  <li class="li">
                    <samp class="codeph nolang">individual</samp> (This value
                    is available in API version 45.0 and later.)
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">employee</samp> (This value is
                    available in API version 46.0 and later.)
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">data_cloud</samp> (This value
                    is available in API version 55.0 and later.)
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">commerce</samp> (This value is
                    available in API version 60.0 and later.)
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">flow</samp> (This value is
                    available in API version 60.0 and later.)
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">semantic_model</samp> (This
                    value is available in API version 60.0 and later.)
                  </li>

                </ul>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d824651e120" data-title="Field Name"><span class="keyword parmname">deployed</span></td>

              <td class="entry" headers="d824651e123" data-title="Field Type">boolean</td>

              <td class="entry" headers="d824651e126" data-title="Description">Required. Indicates whether the report type is available to users
                (<samp class="codeph nolang">true</samp>) or whether it's still
                in development (<samp class="codeph nolang">false</samp>).</td>

            </tr>

            <tr>
              <td class="entry" headers="d824651e120" data-title="Field Name"><span class="keyword parmname">description</span></td>

              <td class="entry" headers="d824651e123" data-title="Field Type">string</td>

              <td class="entry" headers="d824651e126" data-title="Description">The description of the custom report type.</td>

            </tr>

            <tr>
              <td class="entry" headers="d824651e120" data-title="Field Name"><span class="keyword parmname">fullName</span></td>

              <td class="entry" headers="d824651e123" data-title="Field Type">string</td>

              <td class="entry" headers="d824651e126" data-title="Description">The report type developer name used as a unique identifier for
                API access. The <span class="keyword parmname">fullName</span> can contain only
                underscores and alphanumeric characters. It must be unique, begin
                with a letter, not include spaces, not end with an underscore, and
                not contain two consecutive underscores.</td>

            </tr>

            <tr>
              <td class="entry" headers="d824651e120" data-title="Field Name"><span class="keyword parmname">join</span></td>

              <td class="entry" headers="d824651e123" data-title="Field Type"><a class="xref" href="#ObjectRelationship">ObjectRelationship</a></td>

              <td class="entry" headers="d824651e126" data-title="Description">The object joined to the <a class="xref" href="#field_baseObject"><span class="keyword parmname">baseObject</span></a>. For
                example, Contacts can be joined to the primary Accounts
                object.</td>

            </tr>

            <tr>
              <td class="entry" headers="d824651e120" data-title="Field Name"><span class="keyword parmname">label</span></td>

              <td class="entry" headers="d824651e123" data-title="Field Type">string</td>

              <td class="entry" headers="d824651e126" data-title="Description">Required. The report type label.</td>

            </tr>

            <tr>
              <td class="entry" headers="d824651e120" data-title="Field Name"><span class="keyword parmname">sections</span></td>

              <td class="entry" headers="d824651e123" data-title="Field Type">
                <a class="xref" href="#ReportLayoutSection">ReportLayoutSection</a>[]
              </td>

              <td class="entry" headers="d824651e126" data-title="Description">The groups of columns available for the report type. Though
                columns aren’t strictly required, a report without columns isn’t
                useful. </td>

            </tr>

          </tbody>

        </table>

## ObjectRelationship

ObjectRelationship represents a join to another object.

| Field Name | Field Type | Description |
| --- | --- | --- |
| join | [ObjectRelationship](#ObjectRelationship) | This field is a recursive reference that allows you to join more than two objects. A maximum of four objects can be joined in a custom report type. When more than two objects are joined, an inner join isn’t allowed if there has been an outer join earlier in the join sequence. The [baseObject](#field_baseObject) is first joined to the object specified in [relationship](#field_relationship); the resulting dataset is then joined with any objects specified in this field. |
| outerJoin | boolean | Required. Indicates whether it’s an outer join (true) or not (false). An outer join returns a row even if the joined table doesn’t contain a matching value in the join column. |
| relationship | string | Required. The object joined to the primary object; for example, Contacts. |

## ReportLayoutSection

ReportLayoutSection represents a group of columns used in the custom report type.

| Field Name | Field Type | Description |
| --- | --- | --- |
| columns | [ReportTypeColumn](#ReporttColumn)\[\] | The list of columns projected from the query, defined by this custom report type. |
| masterLabel | string | Required. The label for this group of columns in the report wizard. |

## ReportTypeColumn

ReportTypeColumn represents a column in the custom report type.

| Field Name | Field Type | Description |
| --- | --- | --- |
| checkedByDefault | boolean | Required. Indicates whether this column is selected by default (true) or not (false). |
| displayNameOverride | string | A customized column name, if desired. |
| field | string | Required. The field name associated with the report column. |
| table | string | Required. The table associated with the field; for example, Account. |

## Declarative Metadata Sample Definition

The definition of a custom report type is shown in this example. Account is joined to Contacts and the resulting dataset is joined with Assets.

<?xml version="1.0" encoding="UTF-8"?>
<ReportType xmlns="http://soap.sforce.com/2006/04/metadata">
    <baseObject\>Account</baseObject\>
    <category\>accounts</category\>
    <deployed\>true</deployed\>
    <description\>Account linked to Contacts and Assets</description\>
    <join\>
        <join\>
            <outerJoin\>false</outerJoin\>
            <relationship\>Assets</relationship\>
        </join\>
        <outerJoin\>false</outerJoin\>
        <relationship\>Contacts</relationship\>
    </join\>
    <label\>Account Contacts and Assets</label\>
    <sections\>
        <columns\>
            <checkedByDefault\>true</checkedByDefault\>
            <field\>obj\_lookup\_\_c.Id</field\>
            <table\>Account</table\>
        </columns\>
        <columns\>
            <checkedByDefault\>false</checkedByDefault\>
            <field\>obj\_lookup\_\_c.Name</field\>
            <table\>Account</table\>
        </columns\>
        <columns\>
            <checkedByDefault\>false</checkedByDefault\>
            <field\>Opportunity\_\_c.Amount</field\>
            <table\>Account</table\>
        </columns\>
        <columns\>
            <checkedByDefault\>false</checkedByDefault\>
            <field\>Owner.IsActive</field\>
            <table\>Account</table\>
        </columns\>
        <masterLabel\>Accounts</masterLabel\>
    </sections\>
    <sections\>
        <columns\>
            <checkedByDefault\>false</checkedByDefault\>
            <field\>Owner.Email</field\>
            <table\>Account.Contacts</table\>
        </columns\>
        <columns\>
            <checkedByDefault\>false</checkedByDefault\>
            <field\>byr\_\_c</field\>
            <table\>Account.Contacts</table\>
        </columns\>
        <columns\>
            <checkedByDefault\>true</checkedByDefault\>
            <field\>ReportsTo.CreatedBy.Contact.Owner.MobilePhone</field\>
            <table\>Account.Contacts</table\>
        </columns\>
        <masterLabel\>Contacts</masterLabel\>
    </sections\>
</ReportType\>

## Usage

The custom report type refers to fields by using their API names. For a historical field (one that has trackTrending set to true) the API name includes hst, such as Field2\_\_c\_hst.

<sections\>
    <columns\>
        <checkedByDefault\>false</checkedByDefault\>
        <field\>Field2\_\_c\_hst</field\>
        <table\>CustomTrendedObject\_\_c.CustomTrendedObject\_\_c\_hst</table\>
    </columns\>
    <masterLabel\>History</masterLabel\>
</sections\>

For more information, see [trackTrending](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/customfield.htm#tracktrending_name).

## Wildcard Support in the Manifest File

This metadata type supports the wildcard character \* (asterisk) in the package.xml manifest file. For information about using the manifest file, see [Deploying and Retrieving Metadata with the Zip File](https://developer.salesforce.com/docs/atlas.en-us.264.0.api_meta.meta/api_meta/file_based_zip_file.htm).