Clarity

Expand all | Collapse all

How to run report from object instance action link in V15.2

  • 1.  How to run report from object instance action link in V15.2

    Posted Jun 14, 2017 06:39 AM

    Hi,

     

    I want to know how to run the report from project instance actions link. We were using the report type action from the object. But now with 15.2 I don't see the option.

     

    We have few reports that we want to run from object instance. Please suggest me how to achieve this in V15.2 with Jaspersoft reports?

     

    Thanks,

    Shiva



  • 2.  Re: How to run report from object instance action link in V15.2
    Best Answer

    Posted Jun 17, 2017 03:34 PM

     Hi Shiva,

     

    this functionality was removed as of 14.4 when business objects was dropped.

    You can still create external link actions or use javascript to scrape ids and pass into jaspersoft.

     

    Hope that helps

     

    Andrew



  • 3.  Re: How to run report from object instance action link in V15.2

    Posted Jun 18, 2017 03:50 AM

    Hi shiva.s43 ,

     

    You can execute the Jasper reports from Action item by implementing the below steps:

     

    1. Create HTML portlet

     

    <head>

    <style

    type="text/css">

       html, body, div, iframe { margin:0;

    padding:0;}

       iframe { display:block; width:100%;

    border:none; }

    </style>

    <head>

     

    <div>

     <iframe id="myiframe"

    frameborder="0" border="0"

    height="600"></iframe>

    </div>

     

    <script>

    var url1 = window.location.href;

    var location1 = url1.indexOf("projectKey_1=");

    var projectId=url1.slice(-7);

     

    var str1="/reportservice/flow.html?_flowId=viewReportFlow&standAlone=true&ParentFolderUri="+"${FOLDER_PATH}&reportUnit="+"${REPORT FULL PATH}&projectKey_1=";

       

    (For reference)

    var  str1="/reportservice/flow.html?_flowId=viewReportFlow&standAlone=true&ParentFolderUri="+"/shared/reports/Development&reportUnit="+"/shared/reports/Development/CSK_PRJ_ProjectSchedule&populateProject=1&projectKey_1=";

       

    var myiframe = document.getElementById('myiframe');

    myiframe.src = str1 + projectId;

    </script>

     

    2. Create Port let page for above HTML port let.

    3. Add an internal link to that port let page within an clarity object

     

    4. Create new action for that link.

    5. Select that link in view layout of that object.

     

    Do let me know in case of any issue.

     

    Best Regards

    Shubham Bhatia

     



  • 4.  Re: How to run report from object instance action link in V15.2

    Posted Jun 19, 2017 08:06 AM

    Thanks Shubham  

    I will try and let you know.

     

    Regards,

    Shiva



  • 5.  Re: How to run report from object instance action link in V15.2

    Posted Jun 22, 2017 05:38 AM

    Hi Shubham,

     

    I tried the above steps. I have created HTML portlet with the script and preview will take me to the report i wanted to reach. but the project id filter is not working even if I hard code the project id at myiframe.src = str1 + 5645626'';.

     

    I didnt get how to link portlet page to HTML portlet.

     

    <head>
    <style
    type="text/css">
       html, body, div, iframe { margin:0;
    padding:0;}
       iframe { display:block; width:100%;
    border:none; }
    </style>
    <head>
    <div>
      <iframe id="myiframe"
    frameborder="0" border="0"
    height="600"></iframe>
    </div>
    <script>
    var url1 =
    window.location.href;
    var str1=
    "/reportservice/flow.html?_flowId=viewReportFlow&_flowId=viewReportFlow&standAlone=true&ParentFolderUri=/TBS/Reports*&reportUnit=/TBS/Reports/os_prj_sum_rpt&/TBS/Z_Input_Controls/param_inv_id=";
    var location1 =
    url1.indexOf("id=");
    var projectid =
    url1.substring(location1 + 3, location1 + 10)
    var myiframe =
    document.getElementById('myiframe');
    myiframe.src = str1 + projectid;
    </script>

     

     

    Thanks,

    Shiva



  • 6.  Re: How to run report from object instance action link in V15.2

    Posted Jun 22, 2017 05:47 AM

    Hi Shiva,

     

    You have to create a Portlet page with links and these link id along with value will be passed in url so as to capture via html portlet. Now create a link in Object and map your portlet page parameter and then create an action item using link which you can add in your object view.

     

    For Jasper report not working i will suggest that you must try to open that directly in url as 

    $Clarity_URL/reportservice/flow.html?_flowId=viewReportFlow&reportUnit=/shared/reports/ProjectSampleReport&standAlone=true&decorate=no&ParentFolderUri=/shared/reports&output=pdf&Project_Id=5000000

     

    Report Name: /shared/reports/ProjectSampleReport

    ParameterID (excepts projects internal dbid ): &Project_Id=5000000

     

    If this url is wokring then it might be something wrong with HTML and capturing parameter and passing that to you url.

     

    Regards,

    Prashank Singh



  • 7.  Re: How to run report from object instance action link in V15.2

    Broadcom Employee
    Posted Jun 22, 2017 11:24 AM

    Please note this would be considered an unsupported customization:

     

    https://docops.ca.com/ca-ppm/15-2/en/reference/ca-ppm-studio-development/ca-ppm-studio-portlets#CAPPMStudioPortlets-html… 

     

    Tips:

    • The primary purpose of HTML portlets is to display static data. 
    • Do not introduce your own embedded Javascript inside HTML portlets. The injection of custom code with redirected links or references to dynamic external resources is not supported.
    • Do not use the Javascript document.write command in HTML portlets.
    • Do not reload the current page, such as setting window.location.href in Javascript. CA PPM is a single-page Ajax-style application. Reloading the page is not optimal and can result in loss of application state data.

     

     

    Jeanne Gaskill

    Senior Support Engineer

    CA PPM



  • 8.  Re: How to run report from object instance action link in V15.2

    Posted Jun 22, 2017 01:37 PM

    Hi  shiva.s43,

    Can you try this in your HTML code :

     

    var str1=
    "/reportservice/flow.html?_flowId=viewReportFlow&_flowId=viewReportFlow&standAlone=true&ParentFolderUri=/TBS/Reports&reportUnit=/TBS/Reports/os_prj_sum_rpt&param_inv_id=";

     

    After modifying the HTML portlet, create a linking parameter on the page (Name: param_inv_id

                                                                                                                                ID: param_inv_id  ) and add the HTML portlet.

     

    How link between the page and portlet works:

     

    When you create an Internal link on the Object, then you choose the page (In which you had created link) as Action and choose the Object Internal ID in front of the parameter name. This means the object ID would pass in the created parameter link on  the page.

    When creating a new link in object, select the portlet page name available in the Action list. Let me know in case of any issue.

     

    Best Regards

    Shubham



  • 9.  Re: How to run report from object instance action link in V15.2

    Posted Jun 22, 2017 11:19 AM

    Hi Prashank,

     

    The URL is working directly. I am not able to link the portlet page and HTML portlet. in HTML portlet I don't see any linking option. Also in portlet page I created linking parameter but how it will link to HTML portlet. 

    HTML portlet

     

    When creating new link in object I dont see the portlet page link I created.

     

    Thanks,

    Shiva



  • 10.  Re: How to run report from object instance action link in V15.2

    Posted Jun 23, 2017 12:56 AM

    Hi Shiva,

     

    In Html Portlet you are capturing parameter id from URL and this is your linking option in html portlet please refer as shown below:

     

    var url1 = window.location.href;

    alert("URL Captured: "+url1);
    var location1 = url1.indexOf("&ParameterID=");

    alert("index of your parameter used while linking: "+location1);
    var internalid = url1.substring(location1 + 13, location1 + 20);

    alert("internal id passed from object linking being mapped: "+internalid);

     

    Please take care of your parameter which you are going to link, as i can see that you are trying to pick id  which is more relevant when you are fetching information from URL for parameter id.,  will suggest for using alert for entire url and then look into this url for parameter and value which you need to fetch via indexof and substring.

     

    Do let me know if this makes sense to you.

     

    Regards,

    Prashank Singh