0

I'm using iReport 5.0.0 and JasperReports Server 5.0.0.

And my problem is: I have 2 input control, the one is Boolean Type and the other is text box, and the value of text box depend on the value of Boolean is "true" or "false. When the user select "true", I want to show "Y" in text box. and when he select "false" I want to show "N" in text box too.

Please help me to solve this problem.

Alex K
  • 22,315
  • 19
  • 108
  • 236
  • You can look at this post: [JasperReports dynamic input controls](http://stackoverflow.com/q/10443938/876298) – Alex K Jun 28 '13 at 09:39
  • The topic *Cascading Input Controls* of [*JasperReports Server User Guide*](http://community.jaspersoft.com/sites/default/files/docs/jasperreports-server-user-guide.pdf) can help you – Alex K Jun 28 '13 at 09:42
  • Sorry for lately reply, because I must test many solution for clear my problem. And I'm already clear. Thank you very much for your reply, Alex K. Your answer is very helpful for me. Thanks. – Revadee Sakayawong Jul 01 '13 at 07:30
  • Have you checked the answer – Subin Chalil Oct 16 '15 at 18:27

1 Answers1

0

Suppose your Input_Controls's IDs are

  1. input_boolean
  2. input_textarea

For Each input-control there will be parameters inside report, namely $P{input_boolean} and $P{input_textarea}.

To answer your question, In 'Default Value Expression' of $P{input_textarea} use Ternary Operator expression like this

( $P{input_boolean} ? "Y" : "N")

This will works, like charm.

Subin Chalil
  • 3,531
  • 2
  • 24
  • 38