Report

The report component is used to embed a Telerik report in a field.

The connection to the report server comes from configuration parameters, the specific report to be loaded and the search component to be used (if specified) comes from the field definition. All the report parameters come from the Instance/User information except the InputString.  

The InputString by default will be <None />. It will only be populated when a search component is being utilized and will contain the search parameters in XML from the search component. 

In terms of use, there are two workflow paths that will be used to display reports. One is when you’re not using an advanced search component and the second is when you are using an advanced search component. 

  1. When not using advanced search, the report will load as soon as the page loads, the report will immediately be displayed, and embedded parameters that are modifiable will be visible and you’ll be able to filter the report results based on the embedded parameters. 
  2. When an advanced search component is specified in the field definition the initialization process is slightly different. The search component will be rendered, and the report will not be visible however, the report will still be loaded. This is required otherwise we won’t be able to access the reports JS functions (this process will be further discussed in the Advanced Search section). Once the user clicks the “Search” button on the search component, the entered search parameters will be converted into XML and passed to the Report component. The report parameters will then be updated, and the report will be reloaded and then become visible to the user

Report prerequisites

Before you can use the report component you first need to ensure Telerik Reporting is setup in your trellispark environment, you have a report server setup, and have a report to read.

To complete the prerequisites for the Report component, refer to the Telerik reports processes.

  1. Initial setup
  2. Report configuration
  3. Migrating reports across environments

IMPORTANT NOTE: This field has been disabled and if you attempt to put it on a form it will not display. To enable this field you need to follow the instructions in the code of the component: UX-WASM-Components/Fields/GI_Report.razor.

Component code

In the code section of the component there is a list of parameters and variables. All of which contain comments above indicating what they’re used for.

Below are the various methods in the component and their purpose.

OnParametersSetAsync ()

This method is called when the component is initialized and when there’s an update to the parent component. Its purpose is to assign values to variables and call RefreshReportViewer().

UpdateSearchParameters (XElement searchParams)

This method is only used when a search component is being used. When the Search button is selected on the search component, this method will be called.

The searchParams XElement passed into this method will contain the search parameters from the search component. The search parameters are first saved to the searchParameters variable. The report then becomes visible (if it was previously hidden), and the RefreshReportViewer() method is called.

RefreshReportViewer()

This method is used to create the ReportServerOptions and ReportSourceOptions objects that are used to load the correct report and connection info. Once the objects have been created the ReportViewer is refreshed by calling its SetReportSrouceAsync() method and passing the ReportSourceOptions into it.

The ReportServerOptions object contains the username, password, and url for the report server. These values are stored as configuration parameters.

The ReportSourceOptions object contains the report to load (pulled from the field definition) and all the parameters that need to be passed into the report.

Updated on September 27, 2023

Was this article helpful?

Related Articles

Need Support?
Can’t find the answer you’re looking for? Don’t worry we’re here to help!
Contact Support

Leave a Comment