# Core.PageReport

## Content

# Class: PageReport

[Core](../modules/Core).PageReport

Represents the page report API.

**`remarks`**
Use this class to load a report definition or URI and render a [PageDocument](Core.PageDocument).

**`example`**
```ts
const report = new PageReport();
```

## Table of contents

### Constructors

- [constructor](Core.PageReport#constructor)

### Accessors

- [name](Core.PageReport#name)
- [reportParameters](Core.PageReport#reportparameters)
- [resourceLocator](Core.PageReport#resourcelocator)
- [viewSettings](Core.PageReport#viewsettings)

### Methods

- [load](Core.PageReport#load)
- [run](Core.PageReport#run)

## Constructors

### <a id="constructor" name="constructor"></a> constructor

• **new PageReport**(`options?`)

Initializes a new instance of the [PageReport](Core.PageReport) class.

**`example`**
```ts
const report = new PageReport({ language: 'en' });
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `options?` | `Partial`<{ `animations`: `Partial`<{ `charts`: `Partial`<{ `highlight`: { `enabled`: `boolean`  } ; `onHover`: { `enabled`: `boolean`  } ; `onLoad`: { `enabled`: `boolean`  }  }\> ; `table`: { `onHover`: { `backgroundColor`: `string` ; `enabled`: `boolean` ; `textColor?`: `string`  } \| { `enabled`: `boolean` ; `textColor`: `string`  }  }  }\> ; `i18n`: `i18n` ; `language`: `string` ; `memoizeData`: `boolean`  }\> | The PageReport options. |

## Accessors

### <a id="name" name="name"></a> name

• `get` **name**(): `string`

Gets the report name.

#### Returns

`string`

___

### <a id="reportparameters" name="reportparameters"></a> reportParameters

• `get` **reportParameters**(): [`ReportParameters`](../modules/Core#reportparameters)

Gets the report parameters API.

#### Returns

[`ReportParameters`](../modules/Core#reportparameters)

___

### <a id="resourcelocator" name="resourcelocator"></a> resourceLocator

• `get` **resourceLocator**(): [`ResourceLocator`](../modules/Core#resourcelocator)

Gets the report resource locator instance.

#### Returns

[`ResourceLocator`](../modules/Core#resourcelocator)

___

### <a id="viewsettings" name="viewsettings"></a> viewSettings

• `get` **viewSettings**(): `ViewSettings`

#### Returns

`ViewSettings`

## Methods

### <a id="load" name="load"></a> load

▸ **load**(`report`, `options?`): `Promise`<`void`\>

Loads a report template from a URI or a report definition.

**`example`**
```ts
await report.load('report.rdlx-json');
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `report` | `string` \| [`Report`](../modules/Core.Rdl#report) | The report URI or report definition object. |
| `options?` | `Object` | The execution-time settings. |
| `options.environment?` | [`Environment`](../modules/Core#environment) | - |
| `options.reportParameters?` | { `Name`: `string` ; `Value`: [`ParameterVariant`](../modules/Core#parametervariant)[]  }[] | - |
| `options.resourceLocator?` | `Partial`<[`ResourceLocator`](../modules/Core#resourcelocator)\> | - |

#### Returns

`Promise`<`void`\>

A promise that resolves when the report is loaded.

___

### <a id="run" name="run"></a> run

▸ **run**(`logsSubscriber?`): `Promise`<[`PageDocument`](Core.PageDocument)\>

Starts rendering the report and creates a [PageDocument](Core.PageDocument).

Optionally accepts a logs subscriber that will receive rendering logs
during the document creation process.

**`example`**
```ts
const document = await report.run();
// with logs
const document = await report.run((logs, severity) => { console.log(logs, severity); });
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `logsSubscriber?` | `LoggerSubscriber` | Optional callback for collecting render logs. |

#### Returns

`Promise`<[`PageDocument`](Core.PageDocument)\>

A promise that resolves to the rendered document.
