logo

Links to ELMA objects in reports

This article describes how to use hyperlinks to ELMA objects in reports using both FastReport and Razor forms.

This article is useful if you want to create a report with hyperlinks to documents, tasks, projects, object instance, etc. We will consider three examples of creating a simple report with links to similar system objects using the FastReport form, complex reports with links to different object types using FastReport and using Razor markup.

To learn more about reports, read this article

Links to system objects

In ELMA, a link to a page consists of the server address, a constant part, which is the same for all the objects of a certain type, and the object ID.

You can find the link address in the browser URL bar:

Task link example

https://elma.server.com/Workflow/WorkflowTask/Execute/98591

https://elma.server.com/- server address (for a local server the address may be 127.0.0.1, but such an address will work only on the machine that runs the server).

Workflow/WorkflowTask/Execute/ - constant part for process tasks

98591 – task ID.

Attention!

The constant part is different for different task types.

Some examples of the constant parts:

/Workflow/WorkflowTask/Execute/ - process task

/Tasks/Task/Execute/ - user task

/Projects/ProjectTask/Execute/ - project task

/Docflow/Route/RegistrationDocument/ - document registration task

/Common/Catalogs/ViewItem/10?uid=e13b9f1b-b664-432e-b01c-ad060cc0219a – instance of an object with Uid  = e13b9f1b-b664-432e-b01c-ad060cc0219a and instance Id = 10

Example of creating a link to a process instance

A user can create a link to a process instance in the following way:

{BaseUrlSystem}/Processes/Monitor/Index?FilterId=0&Filter.Query=EqlFilter , where

  • {BaseUrlSystem} is the basic URL of the system (it is not required if using the link in a report);
  • /Processes/Monitor/Index?FilterId=0&Filter.Query= is the permanent part of the link, which indicates a specific process from Process Monitor;
  • EqlFilter is the EQL query.

Let's take a look at an example of how the link is created.

      1. Create an EQL query (fig. 2).

 

Fig. 2. Process monitor. Creating an EQL query

This query allows you to select the instances of the P_ProcessAgreement process that were launched by the user with id=1.

      2. Add the created EQL query. The link will look like this:

http://127.0.0.1:8002/Processes/Monitor/Index?FilterId=0&Filter.Query=Id in (from P_ProcessAgreement select WorkflowInstance where Initiator = 1)

      3. When you enter the link into the address bar, you will be shown process instances according to your EQL query (fig. 3).

Fig. 3. Process monitor. Process instances

After the process instances are displayed, the link will look like this:

http://127.0.0.1:8002/Processes/Monitor/Index?FilterId=0&Filter.Query=Id%20in%20(from%20P_ProcessAgreement%20select%20WorkflowInstance%20where%20Iniciator%20=%201)

The spaces in the link are replaced with %20. 

Simple report using FastReport

Let's create a report that shows all the archived documents.

An SQL query for selecting data for the report looks like this:

select DmsObject.Name , Document.Id
from Document
Left join DmsObject on DmsObject.Id=Document.Id
Where IsArchived=’true’;

This query selects the name and ID of a document management object. The ID will be later used in a hyperlink to the object.

To learn more about creating queries for reports, read this article  

Open the Report Layout tab and add the Id and Name columns to the FastReport form.

To add a link to an object, right click on the Name field and select Hyperlink.

In the opened window on the URL tab you can specify a constant link to a web page in the Specify an URL (example: http://www.url.com) field or an expression that calculates the hyperlink address in the or enter the expression that returns an URL field:
Since links to documents have different IDs, you need to add to the second field a formula for calculating the address.

 The formula consists of a constant part in quotation marks, a plus character, and the object ID:

"/Documents/Document/View/"+[Data.Id]
 
Attention!
It is recommended that you use relative links, without specifying the server:
"/Documents/Document/View/"+[Data.Id], instead of "https://elma.elewise.com/Documents/Document/View/"+[Data.Id]

 

Check the box Modify the objectappearance so it will look like clickable link.

To make it easier to enter a formula, you can click on the icon to the right. The Edit expression window will open, where you can add data, system variables, and functions by dragging them from the right column.

Close all the windows by clicking OK and start debugging.

You will see your report, with document names highlighted as hyperlinks, clicking on which opens the page of the respective document.

 
Useful information

This article in the first of the three articles dedicated to creating links in reports.

To learn how to create a report with links to different object types using the standard FastReport form, read this article.

To learn how to use links in a report with Razor markup, read this article.