我有一个PostgreSQL函数:
func(timestamp,timestamp,Integer[],varchar[])
我想设计一个JasperReports报告来从函数中获取数据。为此,我创建了 list 类型的参数以从用户那里获取输入并将其作为varchar数组传递。
为此,我正在尝试使用以下查询:
select * from func($P{interval_start}::timestamp,$P{interval_end}::timestamp,array[$P!{idParameter}],array[$P!{usersParameter}])
但是当我运行报告时,它会给出类似column user1(passed from parameter) does not exist
.
我也试过:
select * from func($P{interval_start}::timestamp,$P{interval_end}::timestamp,array[$P!{idParameter}],array[$P{usersParameter}])
但它说:
Compiling to file... /home/Prashant/Desktop/jasper-report/report2.jasper
net.sf.jasperreports.engine.design.JRValidationException: Report design not valid :
1. Parameter type not supported in query : usersParameter class java.util.Collection
at net.sf.jasperreports.engine.design.JRAbstractCompiler.verifyDesign(JRAbstractCompiler.java:258)
at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:140)
at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:212)
at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:128)
at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:516)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)
Compilation running time: 73!
请建议,如何将字符串数组从iReport传递给PostgreSQL函数?