You can find this report in the x4Trace sample database. Its name is Order instance values.
This report reports the traced values of products.
The SQL statement is the next:
Code: Select all
select instancesandvalues.instanceid as ID,
instancesandvalues.code as Code,
(select name from FlowVariable where flowid = (select flowid from[Order] where id = @orderid) and FlowVariable.varid = instancesandvalues.varid) as Parameter,
instancesandvalues.val as [Value]
from
(select OrderInstance.instanceid, OrderInstance.code, allvalues.varid, allvalues.val from
(select * from OrderInstance where orderid = @orderid) as OrderInstance inner join
((select instanceid, varid, val from ProductionProcessOutputVarTxt where orderid = @orderid) union all (select instanceid, varid, concat('',round(val, 2)) as val from ProductionProcessOutputVarNum where orderid = @orderid)) as allvalues
ON OrderInstance.instanceid = allvalues.instanceid) as instancesandvalues order by [Code], [Value]
This parameter's GUI is a combo box. You can set the GUI in the type column of the input grid. The report is edited on the left side, and the report is viewed on the right side. The variable name is @orderid. This variable name is used in the SQL statement. You can set the combo box's values by filling the input control's CMD.