Jasper Report in HTML Portlet

Blog Post created by PRAAM04 Employee on May 31, 2018
  1. Create copy of a particular report.
  2. Select object's id on the basis of sub-object id within the query. For instance, my report runs on the basis of "Project ID" & I want to run that report for action item created for "Status Report" sub-object as well. So, the url for a particular status report will provide the sub-object id & that Id will be passed to my parameter which is expecting Project ID. In my query, I've used "Select odf_parent_id from tablename where id=parametername" for getting the project id.


Sample Code of HTML Portlet:




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

   iframe { display:block; width:100%;
border:none; }




  <iframe id="myiframe"
frameborder="0" border="0"



var url1 =

var str1=

var location1 =

var projectid =
url1.substring(location1 + 3, location1 + 10)

var myiframe =

  1. src = str1
    + projectid;


Key HTML Code


HTML Reference


Derived Location


Application page reference



Execution action. (report,ad-hoc view,dashboard, etc…)

Object type to be executed


Path to report location

Repository location with report id appended. The final value in the string is the report id. Can be copied from url when directly logged into JasperReports Server.


Parameter id associated with report parameter

Report input control reference.

Var location1

Variable storing identifier for substring locations

Set the index based on value in url

Var projectid

Substring to pull id from url based on location index

Modify based on start and end locations of key field in the url

Var myiframe =

Leverage ‘myiframe’ technology


A.      Myiframe.src=

Concatenate the url ‘str1 variable with projectid variable



Hide JasperReports Server Main Menu bar



Dictates report output. (pdf, html, excel, etc…)