Jump to content
Changes to the Jaspersoft community edition download ×

Problem with IFRAME. Frame is lost.

2005 IR Help

Recommended Posts

By: Nicolai - nicolaihoge

Problem with IFRAME. Frame is lost.

2004-10-08 03:03


I am using an IFRAME in my jsp to display the

report. The rest of the page displays input options.

The JasperReports are generated in a Struts action. The problem is that when I have the path to action as the src attribute in my IFRAME the resulting report is displayed on the complete page, not just inside the IFRAME. The input controls aare gone.


Code generating report:


Connection conn = getConnection();


JasperReportForm reportForm = (JasperReportForm) form;


// Load parameters

Map params = new HashMap();




// Load and fill report

JasperReport report = (JasperReport)


+ reportForm.getReportName() + JASPER_EXT);

JasperPrint jasperPrint =

JasperFillManager.fillReport(report, params, conn);


// Set common exporter parameters, specific ones should have been set

// by calling method

exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);

exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, bos);


// Export report




JSP sourcecode:


<table width="100%">


<nested:form action="/keyword-traffic">

<nested:select property="selectedDomain" onchange="loadInput()">

<nested:optionsCollection label="countryPrefix" value="id" property="domains"/>


<nested:select property="selectedKeyword">

<nested:optionsCollection label="keyword" value="id" property="keywords"/>





<html:submit property="method" value="html">HTML</html:submit>

<html:submit property="method" value="pdf">PDF</html:submit>

<html:submit property="method" value="xls">XLS</html:submit>



<iframe width="100%"src="/web-reports/action/keyword-traffic?method=<bean:write name="keyword_traffic_form" property="method"/>">













By: Nicolai - nicolaihoge

RE: Problem with IFRAME. Frame is lost.

2004-10-08 03:19

Never mind. I found out what happened.

WHen i submit the outer page (i.e. the one that contains the IFRAME) the report is also generated on that one, and then written back to the response instead of the jsp containing the

input controls, and the IFRAME

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...