# Report Rendering in Modernized Code

This section describes where reports are rendered in the application UI and the mechanisms that make them work.

## Reports in the UI <a href="#reports-in-the-ui" id="reports-in-the-ui"></a>

Reports are rendered inside `DataManagerControl` controls. These controls are added to the frontend component templates using the following descriptor:

```
                    

```

The following line is used to configure a `DataManagerControl` to display a report.

```
this.myDataManagerControl.Object.Print.Preview = true;
```

This property is transferred to the code executed in the frontend using the synchronization mechanism (*TODO LINK TO SYNC PROCESS*). This property instructs the frontend to display a PDF Viewer in the area assigned to the *DataManagerControl*.

This PDF Viewer control is requests a PDF using the *DataManagerController.printDataManager* endpoint.

The implementation of the *DataManagerController.printDataManager* endpoint calls ReportWatcher and returns the rendered PDF.

## Implicit use of the *ReportWatcher* service <a href="#implicit-use-of-the-reportwatcher-service" id="implicit-use-of-the-reportwatcher-service"></a>

Notice that modernized applications should not call the *ReportWatcher* service directly. This service is automatically called when having a `DataManagerControl` (TODO ADD REFERENCE TO DATAMANAGER DOCUMENTATION) configured to show itself as a report.

## Report rendering internals <a href="#report-rendering-internals" id="report-rendering-internals"></a>

The following diagram shows a summary on how the different components interact when processing a report request.

Part of the process of creating a report from a DataManager involves :

1. Converting the DataManager to a SSRS report definition in RDL format
2. Extracting the data of the report and generating a System.Data.DataSet dump of all the data required to render the report.

These processes are described in the [RDL Conversion section](http://product-docs.azurewebsites.net/PBNet/articles/reports/RDLConversion.html).


---

# Agent Instructions: 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:

```
GET https://docs.gapvelocity.ai/webmap/powerbuilder-to-.net/reports/report-rendering-in-modernized-code.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
