Jump to content
Changes to the Jaspersoft community edition download ×

How to write conditional sql query for ireport parameter?


raghavendram040

Recommended Posts

I am new to Ireport and jasperreport What I am trying is, I have a select dropdown in html shows groups once select a group and click submit it should generate report of all vehicles under that group. in dropdown I have a value All , If i select that it should generate report of all vehicle under perticuler user. So I have created parameters in I report as follow ,

 

    $P{querycontroler}==>default value is :$P{gp}.equals("All")?$P{byuser}:$P{bygrp}

    $P{bygroup}==>default value is:"SELECT * FROM vehicle_details where client_id=$P{user} and group_name=$P{gp}"

   $P{byuser}==>default value is:"SELECT * FROM vehicle_details where client_id=$P{user}"

    $P{gp}==>promts to enter group(selected dropdown value )

   $P{user}==>promts to enter user(user who logged in application)

 

   and when I write a report query as $P!{group} , it doesnt reads fields of table instead it just shows `Error:null`. How to solve this please help me in this.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...