Clarity

  • 1.  Mappings between Input control in jaspersoft server and Parameter in jaspersoft Studio

    Posted Sep 19, 2017 11:40 AM

    Hi All,

     

    Have a Good day!

     

    I have created custom report using Jaspersoft Studio and upoladed the jrxml into the jasper soft report server.

    In the Jaspersoft Studio i am using parameters for project ID and Project name and it is working in Studio report.

     i have upload the jrxml to Jaspersoft  report Server  and i gave input control to project id and project name. 

     

    When i try to run this it is taking long time to run and it is getting failed. IF i provide the project id directly into the query then it working in Jaspersoft report server. i have given is prompt option and now it is prompting the screen but there is no field to enter project id.

     

    i have mapped input control as per the studio parameter.

     

    Could some one help me on this.

     

    There is no option to enter input:

     

     

    In the code, i have added parameter:

     

     

    Thanks,

    Thenmozhi K



  • 2.  Re: Mappings between Input control in jaspersoft server and Parameter in jaspersoft Studio

    Posted Sep 19, 2017 03:43 PM

    Hi Thenmozhi,

     

    See if this helps: Using Report Parameters in Jaspersoft Studio | Jaspersoft Community 

     

    So, if the SQL behind your report right now is:

    select investment_name, investment_key

    from dwh_inv_investment

     

    Then, I think you need to change it to:

    select investment_name, investment_key

    from dwh_inv_investment

    where investment_key = $P{inv_key}

     

    Where inv_key is your parameter.

     

    You can also use a format such as "$P!{inv_key}". But more on how it can be made use of, is explained in the link provided above.



  • 3.  Re: Mappings between Input control in jaspersoft server and Parameter in jaspersoft Studio

    Posted Sep 20, 2017 04:31 AM

    Hi Jeevan,

     

    Thanks for your help.

     

    My requirement is I need to take a report for more than one projects. So I have passed parameter in IN operator as below:

    and prj.UNIQUE_NAME = $P{paramProjectId}

    please correct me if I wrong,.

     

    Thanks,

    Thenmozhi



  • 4.  Re: Mappings between Input control in jaspersoft server and Parameter in jaspersoft Studio

    Posted Sep 20, 2017 07:21 AM

    Hi Thenmozhi,

     

    in this case, you have to use the $X{} clause, e.g.

    WHERE $X{IN, prj.UNIQUE_NAME, paramProjectId}

     

    Please be aware that the $X{} clause would produce a true condition in case the list in paramProjectId is empty.

    In the report, you have to use the java.util.Collection as datatype for the parameter.

     

    For details, please check:

    Using Parameters in Queries | Jaspersoft Community 

     

    Regards

    Georg