0

I have a requirement in IReport. In this i want to make table name as a parameter. Is it possible in ireport to pass it as a parameter? Does jasper support this?

Thanks, Ben

benz
  • 4,561
  • 7
  • 37
  • 68
  • The *iReport* is just a gui designer for building report's templates. Are you sure that you talking about *iReport* not about *JasperReports* library? – Alex K Jun 26 '14 at 13:00
  • 3
    Yes, you can. Sample: `<![CDATA[SELECT id FROM $P!{tableName}]]>`. You can read more details in [JasperReports: Passing parameters to query](http://stackoverflow.com/a/11877972/876298) post. – Alex K Jun 27 '14 at 11:47
  • Thanks @AlexK, i was able to achieve this effect yesterday by following same answer your provided. I upvoted it as well. Thanks so much. – benz Jun 27 '14 at 13:20

1 Answers1

0

Look at this exemle it will help you

If parametre Type = 0 Then the choice will be Name1 ...............

    (
    $P{Type} == "0" ?
    "Name1" :
    $P{Type} == "1" ?
    "Name2" :
   $P{Type} == "2" ?
    "Name3" :
    "Default Name"
    )
user3684431
  • 29
  • 1
  • 5