CA Service Management

  • 1.  CABI 6.2 showing boolean value in variable

    Posted Jun 20, 2017 04:57 PM

    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




  • 2.  Re: CABI 6.2 showing boolean value in variable

    Posted Jun 26, 2017 01:21 PM

    Hello Samba,

     

    This is a custom Studio report.
    There is a community for jaspersoft where you can register and ask questions such as this for peer input. You would register and ask your question under the "answers" tab.
    Please refer to http://community.jaspersoft.com/  where you might find experts with the correct steps/response to help you.

     

    -Carol Uranker



  • 3.  Re: CABI 6.2 showing boolean value in variable
    Best Answer

    Posted Jul 05, 2017 05:56 PM

    Hi Carol,

     

    I got it through small changes to parameter changes.

     

    1.changed the Boolean parameter type to java.util.collection.

    2. defined input control with list of values (Yes - 1, No - 0)

    3. modified SQL to query from list of items in stead of using $P

     

     

     

    It works perfectly and I can query based on Active Yes/No status

     

    Thanks,

    Samba.



  • 4.  Re: CABI 6.2 showing boolean value in variable

    Posted Jun 26, 2017 01:24 PM

    Thanks Carol