DX Unified Infrastructure Management

Expand all | Collapse all

Does Jaspersoft Studio allow the creation of "account-aware" reports?

  • 1.  Does Jaspersoft Studio allow the creation of "account-aware" reports?

    Posted Dec 14, 2017 08:55 PM

    In the old Unified Reports, we had a query executor called "nimsoft" that would insert the current user's account ID into a query so you could have a single query that filters the result for just that account.  I don't see something similar for Jaspersoft Studio.  How can a service provider have a single report that correctly filters so that each customer just sees their own data?



  • 2.  Re: Does Jaspersoft Studio allow the creation of "account-aware" reports?

    Posted Dec 15, 2017 04:58 AM

    Hello dick.cooman,

     

         JSS (JasperSoft Studio)  can  use the server built in parameter userTenantId, witch is mapped to the user organization wich is the user account.

        When cabi/cabi_external does the integration It creates the following organization structure:

      --- UIM

      ------ ACCOUNT 1

      ------ ACCOUNT 2

    ....

       That way you can use the user account as a parameter to perform the query.

       About the default dashboard and reports that came with the probe they encapsulate the querys on an undocumented Jar  the uim_core_dashboard_utils.jar, that might encapsulate that too

       Well I hevan't tested that yet, but i think that Will work

     

    Regards.



  • 3.  Re: Does Jaspersoft Studio allow the creation of "account-aware" reports?

    Posted Dec 15, 2017 11:24 AM

    Did you find an example of using this userTenantId?



  • 4.  Re: Does Jaspersoft Studio allow the creation of "account-aware" reports?

    Posted Dec 15, 2017 01:14 PM

    Renato,

     

    Does userTenantId work even if the report is located in the Public area and not under the specific organization's report area?

    This would help me a lot if it does.  That way I can share reports over multiple organizations and each one will apply its own userTenantId.

     

    Thanks for all your help.  I really appreciate it.

     

    Luc - not yet.  But I will check for some examples before I begin coding.  Thanks.

     

    -- Dick



  • 5.  Re: Does Jaspersoft Studio allow the creation of "account-aware" reports?

    Posted Dec 15, 2017 02:03 PM

    Hello Dick,

         These parameters work on Public folder, and the easiest way to use the is:

          Right click on parameters and create parameter set, then chose the built in parameters, and use the userTenantId.

         On the report query that parameter Works well, but on Input Controls I think It requer some customozation on the server to work.

        About the example i Will try to create a simple report and post a tutorial my blog, 

     

    Regards.



  • 6.  Re: Does Jaspersoft Studio allow the creation of "account-aware" reports?

    Posted Dec 18, 2017 10:48 AM

    Renato,

    I have exposed the built-in parameters but when I use them in the query, I get this error:

    Report design not valid : 1. Parameter type not supported in query : LoggedInUserTenantId class com.jaspersoft.jasperserver.api.metadata.user.domain.User

    Do I need to enable a class on the Jasperserver?



  • 7.  Re: Does Jaspersoft Studio allow the creation of "account-aware" reports?

    Posted Dec 18, 2017 03:55 PM
      |   view attached

    Hello,

        I'm hevan't made any customization on mine server, and it works. the cabi I'm using is the one that came with Spectrum, and I'm using the cabi_external probe.

       And the attached file is a very simple example, the error that you show apears on JSS or on the server? if is on Studio try to set a default value since the Studio haven't any data about the user

     

    Regards

    Attachment(s)

    zip
    Tenant.jrxml.zip   1 KB 1 version


  • 8.  Re: Does Jaspersoft Studio allow the creation of "account-aware" reports?

    Posted Dec 18, 2017 04:05 PM

    Renato,

    That may be the difference.  We are using the CABI that is specific to UIM.  I have a CA expert helping on Wednesday.

    Best regards and thanks for your continued help,

     

    Dick



  • 9.  Re: Does Jaspersoft Studio allow the creation of "account-aware" reports?

    Posted Dec 18, 2017 05:11 PM

    You're welcome, and if you have time please share the solution with us
    Regards



  • 10.  Re: Does Jaspersoft Studio allow the creation of "account-aware" reports?

    Posted Dec 23, 2017 04:54 PM

    Everyone,

     

    I found the right combination and I have the account-aware reports working in the newest CABI.  It is different than the others in the community said and I understand it is because we are using the internal UIM CABI.

     

    There are four steps to add multi-tenancy to a public report:

     

    1)  Create a parameter called "LoggedInTenantAttribute_allowed_origins" in the report as a String.  Set the default value to "SELECT DISTINCT ORIGIN FROM S_QOS_DATA" so it will work if you are not in an Organization.

    2) Add the parameter to the WHERE clause of the SELECT statement like this: "AND origin IN ($P!{LoggedInTenantAttribute_allowed_origins})"

    3) In the report properties, add "com.ca.uim.cabi.common.ReportUtils" to the "Imports" section.  Set the report language to "Java".

    4) Copy and paste the file "uim.core.dashboards_utils.jar" as a resource along side of the report source and any input controls.

     

    This correctly filter the report to include only those origins the Organization can see. I have learned that the Spectrum version of CABI handles multi-tenancy differently.  This solution only works if you are using the internal UIM version.

     

    Thanks to everyone who responded.  I hope this will help those who are working on the same problem.



  • 11.  Re: Does Jaspersoft Studio allow the creation of "account-aware" reports?

    Posted Jan 05, 2018 03:24 PM

    People have asked where to find the uim.core.dashboards_utils.jar file.

    In the repository, drill down to public/ca/UIM/report/common

    In the folders below, check any report folder and you will find a copy of this jar file.