CreateReportSchema
Allows for saving a dynamic Profit and Loss report as a custom schema. This is useful for generating recurring reports that meet specific financial analysis needs.
CreateReportSchema
CreateReportSchema creates a schema file based on the specified report. This schema adds a table to your existing list that corresponds with the results of your report, which can then be queried like other tables. (Reports from the Xero are not modeled by connector as queryable tables by default.)The generated schema file outlines the metadata for the report, such as columns and column data types. You can edit the file to adjust data types, rename columns, and include or exclude columns.
Updating a Report Schema
In the following example, the SP CreateReportSchema creates a new report using TestReportTest1 as a base template. It appends new columns to TestReportTest1 and creates a new report, named TestReport2. The new report is saved as ...\\TestReportTest2.rsd.EXECUTE [CreateReportSchema]
[ReportName] = "TestReportTest2",
[CustomFieldIdsPrimitive] = "1459925,1459928",
[CustomFieldIdsDropdown] = "1469785",
[CustomDimensionKeyIds] = "13539564",
[BaseReportName] = "TestReportTest1",
[FileName] = "...\\TestReportTest2.rsd"
Input
| Name | Type | Required | Description |
| ReportName | String | True | The name to be assigned to the generated report. If 'FileStream' and the 'Location' connection property are not set, the associated file will be saved in the file path specified in the 'Location' property. |
| Periods | Int | False | The number of periods to look back from the 'ToDate'. This defines the period range for the report, allowing users to focus on a specific number of historical periods for comparison. |
| Timeframe | String | False | Specifies the size of each period for the report. Valid options include 'MONTH', 'QUARTER', or 'YEAR', determining whether each period in the report represents a month, a quarter, or a full year. |
| TrackingCategoryID | String | False | The ID of the tracking category. If specified, the Profit and Loss Report displays figures for each option within the category as separate columns, allowing detailed tracking of financial performance by category. |
| TrackingCategoryID2 | String | False | The ID of a second tracking category. If specified along with 'TrackingCategoryID', the 'Profit and Loss Report' will show figures for each combination of options from the two categories as separate columns, providing a detailed multi-dimensional view of financial data. |
| TenantId | String | False | The unique identifier for the tenant. This allows queries to retrieve data specific to a particular tenant, rather than using the default connection tenant. This is useful in multi-tenant environments where data for different tenants is handled separately. |
Result Set Columns
| Name | Type | Description |
| Success | String | A boolean value indicating whether the operation was successful. 'True' means the report was generated and processed correctly, while 'false' indicates that an error occurred. |
| FileData | String | Contains the Base64-encoded content of the generated file, if 'DownloadPath' and 'FileStream' are not provided. This allows the file to be retrieved and stored externally in Base64-encoded format. |