Clarity

Expand all | Collapse all

Jaspersoft Mandatory input control - No value as default

Jump to Best Answer
  • 1.  Jaspersoft Mandatory input control - No value as default

    Posted 02-21-2017 05:16 AM

    Hi,

     

    I've designed a custom Jaspersoft report, which has Parameter "Project Name", . I set this as Mandatory Input control in Jaspersoft Server, which is query based Single select Lookup. But I would like to have Default value has no value(not null), as it always shows my first project as default value. It should look like the any single select lookup field which we use in Clarity. 

     

    Any suggestions?



  • 2.  Re: Jaspersoft Mandatory input control - No value as default

    Posted 02-21-2017 06:00 AM

    HI Sreeram,

     

    Check out of box Project Story board for OBS attribute, we set "----" as default value.

     

    Regards
    Suman Pramanik 



  • 3.  Re: Jaspersoft Mandatory input control - No value as default

    Posted 02-21-2017 07:58 AM

    Hi,

     

    When I checked this Project Stoy board  report, I checked the Query and also Input control, there is no specific value mentioned as ----. I could see the input control is not even mandatory and has the query as follows.

     

    SELECT obs.obs_unit_key AS obs_unit_key,
    obs.obs_unit AS obs_unit,
    obs.obs_path AS obs_display_name,
    obs.hierarchy_level AS hierarchy_level
    FROM dwh_lkp_obs_unit obs
    WHERE obs.is_investment_obs = 1
    AND obs.obs_type_key = $P{projectOBSTypeKey_1}
    ORDER BY obs.hierarchy_level

     

    This is n't much helpful. Please advise am I checking the correct query

     

    FYI, I'm using Clarity 14.2 with Patch 7 and Jaspersoft 5.6.1

     

    Thanks

     

    Sreeram



  • 4.  Re: Jaspersoft Mandatory input control - No value as default

    Posted 02-21-2017 08:16 AM

    Hi Sreeram,

     

    Yes that attribute is not mandatory but it has --- at the front. Now coming to put blank as default, its picking up the data from database, you need to have a null record in database and set that mandatory.

     

    This might help but not with blank though https://www.ca.com/us/services-support/ca-support/ca-support-online/knowledge-base-articles.tec1887779.html 

     

    Regards

    Suman Pramanik 



  • 5.  Re: Jaspersoft Mandatory input control - No value as default
    Best Answer

    Posted 02-21-2017 04:24 PM

    Hi Sreeram,

     

    When setting the input control as mandatory it looks like Jasper defaults to the first row returned.  

     

    You could change the input control query to return a blank row first which would enable the behaviour you prefer.       

     

    For example if your project input control query is

     

    SELECT i.investment_name AS investment_name FROM dwh_inv_investment i...

     

    You can add a SELECT/UNION as shown below which will return a blank row first and then the rows containing the project names.  

     

    SELECT  ' ' AS investment_name FROM dwh_inv_investment ...

    UNION

    SELECT i.investment_name AS investment_name FROM dwh_inv_investment i...

     

    Hope this helps....

     

    Steve

     

     

     

     

     



  • 6.  Re: Jaspersoft Mandatory input control - No value as default

    Posted 02-22-2017 01:08 AM

    Awesome Idea and simple one.. Thanks Steve. Cheers

     

    Sreeram