logo

Adding a document name to the subject of a consideration task in the schedule compliance report

Often a report is submitted to a manager in the printed form, and in this case, the consideration tasks are not very informative, since there is no name of the considered document. For the name to be shown, you need to change the standard report.

Fig. 1. Display of a consideration task in the standard schedule compliance report

Since you cannot edit system reports, you need to create a copy of this report.

Fig. 2. Copying the standard report

Change the query text, the very beginning:

SELECT [User].Fullname AS UserFullName, Taskbase.EndDate AS EndDate, 
                    TaskBase.EndWorkDate AS EndWorkDate,
                    TaskBase.StartDate AS StartDate,
                    TaskBase.Executor AS Executor,
                    TaskBase.TypeUid AS TypeUid,
                    TaskBase.Id AS TbId,
                    TaskBase.IsEmulation,
                    TaskBase.Status,
                    TaskBase.Subject,

 The task name is defined in TaskBase.Subject, since you need to change the name only for the consideration task, use the CASE expression.

SELECT [User].Fullname AS UserFullName, Taskbase.EndDate AS EndDate,
                    TaskBase.EndWorkDate AS EndWorkDate,
                    TaskBase.StartDate AS StartDate,
                    TaskBase.Executor AS Executor,
                    TaskBase.TypeUid AS TypeUid,
                    TaskBase.Id AS TbId,
                    TaskBase.IsEmulation,
                    TaskBase.Status,
                     (TaskBase.Subject + ’ ’ + (CASE
                    WHEN TaskBase.Resolution IS NOT null
                    THEN (SELECT dms.Name FROM Resolution r, DmsObject dms WHERE TaskBase.Resolution = r.Id AND r.Document = dms.id)  ELSE ’ ’ END)) AS Subject,

 The system checks if there are consideration tasks; if yes, the document name from the DMSObject table is added to the task name.

Fig. 3. Display of a changed consideration task in the schedule compliance report