我正在尝试将 ${SubLocationId} 参数传递给 Pentaho 报告中使用的查询,如下所示
SELECT
UTD.Vehicle,
UTD.Location,
UTD.SubLocation,
UTD.HourCreated,
UTD.VehicleId,
UTD.SensorPosition,
(SELECT Pressure FROM DailyTyreData WHERE Created = UTD.Created AND VehicleId = UTD.VehicleId AND UTD.SensorPosition = SensorPosition) AS Pressure,
(SELECT Temperature FROM DailyTyreData WHERE Created = UTD.Created AND VehicleId = UTD.VehicleId AND UTD.SensorPosition = SensorPosition) AS Temperature
FROM
(SELECT
DTD.ExternalReference AS Vehicle,
DTD.Location,
DTD.SubLocation,
DTD.HourCreated,
DTD.VehicleId,
DTD.SensorPosition,
MAX(DTD.Created) AS Created
FROM
DailyTyreData DTD
WHERE
DTD.SubLocationId = ${SubLocationId}
GROUP BY
DTD.ExternalReference,
DTD.SubLocation,
DTD.Location,
DTD.HourCreated,
DTD.VehicleId,
DTD.SensorId,
DTD.SensorPosition) UTD
ORDER BY
UTD.Created
尝试预览报告时出现以下错误
org.pentaho.reporting.engine.classic.core.ReportDataFactoryException: Failed at query:
at org.pentaho.reporting.engine.classic.core.modules.misc.datafactory.sql.SimpleSQLReportDataFactory.queryData(SimpleSQLReportDataFactory.java:258)
at org.pentaho.reporting.engine.classic.core.modules.misc.datafactory.sql.SQLReportDataFactory.queryData(SQLReportDataFactory.java:171)
该参数已添加到报表设计器参数部分的输入参数中。发生这种情况有什么原因吗?