以下に示すように、Pentaho レポートで使用されるクエリに ${SubLocationId} パラメータを渡そうとしています。
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)
このパラメーターは、レポート デザイナーのパラメーター セクションの入力パラメーターに追加されました。これが起こっている理由はありますか?