Clarity

  • 1.  Multi select OBS in Jasper report

    Posted Nov 20, 2018 02:31 AM

    Hi We have a requirement where in we have to do the OBS (project OBS ) as multi select in jasper. any sample query for this please?

     

    we have tried.. $X{IN,Project_obs_key, prj_obs_units.name} but this did not work.



  • 2.  Re: Multi select OBS in Jasper report

    Posted Nov 20, 2018 08:34 PM

    Can you eleberate what 'Project_obs_key' is, I know it is a parameter, but I will assume that you are passing the OBS Key (which will be a 5000000 number), and yet in the report you are then attempting to match it the OBS Name (which is a string attribute which stores the value of the OBS name and has nothing to do with potentially the OBS Branch ID you are passing in).  Please review OOTB reports including Project Status Detail which will show you example SQL how to match correctly the data - note these are using the Data Warehouse schema.

     

    I'm taking a stab, your report is not using the Data Warehouse schema, you are going directly the PPM schema, but regardless, the 'IN' won't work as you are still comparing 5,000,000 OBS Branch number with the OBS Name and sample query would be something like:

    AND   ($P{param_i_obs} IS NULL OR
           i.id IN (SELECT obsa.record_id
                    FROM   prj_obs_associations obsa, prj_obs_units_flat obsf
                    WHERE  obsa.unit_id = obsf.unit_id
                    AND    obsa.table_name = 'SRM_PROJECTS'
                    AND    obsf.branch_unit_id = $P{param_i_obs}))



  • 3.  Re: Multi select OBS in Jasper report

    Posted Nov 21, 2018 07:27 AM

    I understand that i am doing a wrong comparison, however the query is the same as you mentioned here. My ask is how to make it as multi select. The query mentioned above is only single select. Can make the input control query as just multi select query? or just add  AND $X {IN, obsf.branch_unit_id , param_obs} or

     

    AND   ($P{param_i_obs} IS NULL OR
           i.id IN (SELECT obsa.record_id
                    FROM   prj_obs_associations obsa, prj_obs_units_flat obsf
                    WHERE  obsa.unit_id = obsf.unit_id
                    AND    obsa.table_name = 'SRM_PROJECTS'
                    AND    $X {IN, obsf.branch_unit_id , param_obs}))

     

    Please suggest



  • 4.  Re: Multi select OBS in Jasper report

    Posted Nov 21, 2018 05:00 PM

    Hboggavarapu - Did you try making a change in the input control query (something like $X{IN} etc) AND also edit the input control settings to multi-select query?

     

    Though I haven't tried OBS, I have made this for other query and list based parameters, and it worked.