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:
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.
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
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
Left join DmsObject on DmsObject.Id=Document.Id
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:
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 object’s appearance so it will look like a 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.
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.