0

I am using i-Report 5.6.0 to design my report. It is working fine when I am giving the value hard coded for the parameter $P{collectedStudentIds}. But when I am sending this value as this parameter it does not show the same result. Although the passed parameter value is the same as I have used as hard coded. What can I try next to solve this?

My query is given below :

    select cn.id as class_id, cn.class_name, s.id as student_id, s.name
from student s
inner join class_name cn
 on (s.class_name_id = cn.id)

where 1=1
and s.id not in (
    $P{collectedStudentIds}
)
order by cn.id, s.id

And my hard coded value which is same passed by parameter :

1,3,4,8,10,11,12,17,18,22
halfer
  • 19,824
  • 17
  • 99
  • 186
Sumon Bappi
  • 1,937
  • 8
  • 38
  • 82
  • It may be treating it as a string and enclosing it in quotes. Don't know if you can pass it in as an array as I don't know the package your using. – Nigel Ren Oct 19 '19 at 09:08

1 Answers1

0

It is solved.

Just use the parameter with this sign when pass string literal from server

$P!{collectedStudentIds}

https://community.jaspersoft.com/questions/1030546/how-pass-string-xin-using-url

Sumon Bappi
  • 1,937
  • 8
  • 38
  • 82