AnsweredAssumed Answered

CABI 6.2 showing boolean value in variable

Question asked by Sparasa.1 on Jun 20, 2017
Latest reply on Jul 5, 2017 by Sparasa.1

I want to show Active/Inactive/both assets in Jasper report. since the field type is boolean, I created a variable with definition like below ..

 

 $F{inactive}.intValue() != 1?"ACTIVE":"INACTIVE"

 

I could add the variable name "Active Status" in Report and see Active and Inactive assets...instead of 1 or 0.

 

However, If we use the parameter in Jasper server ..there is no option to select values based Variable Value.

Since Parameter and Variable are not linked.

 

Sample report

 

SQL query in report

SELECT dbo.ca_owned_resource.resource_name,
    dbo.ca_owned_resource.resource_description,
    dbo.ca_owned_resource.inactive,
    dbo.ca_owned_resource.serial_number,
    dbo.ca_owned_resource.purchase_order_id,
    dbo.ca_owned_resource.host_name,
    dbo.ca_resource_family.name AS "Asset Family",
    dbo.ca_resource_status.name AS "Service Status",
    dbo.ca_asset_lifecycle_status.name AS "Lifecycle Status",
    dbo.ca_resource_class.name AS "Class"
    FROM dbo.ca_owned_resource
    INNER JOIN dbo.ca_resource_family ON
     dbo.ca_owned_resource.resource_family = dbo.ca_resource_family.id
    INNER JOIN dbo.ca_resource_status ON
     dbo.ca_owned_resource.resource_status = dbo.ca_resource_status.id
    INNER JOIN dbo.ca_asset_lifecycle_status ON
     dbo.ca_owned_resource.lifecycle_status = dbo.ca_asset_lifecycle_status.id
    INNER JOIN dbo.ca_resource_class ON
     dbo.ca_owned_resource.resource_class = dbo.ca_resource_class.id
     WHERE
     dbo.ca_owned_resource.inactive = $P{inactive}
     AND (
     $X{IN,dbo.ca_resource_family.name,p_AssetFamily})

 

 

How do we link parameter and Variable so that we can select 'Active' for assets with flag 1 and 'Inactive' for flag value 0 and Select both 1 and 0 for All Assets?

 

Instead of Showing "inactive" field as boolean field, I want to show it as List of Values?

 

Boolean parameter in Jasper

 

Variable based filtering in Boxi 3.X/4.X


Outcomes