Jump to content
We've recently updated our Privacy Statement, available here ×

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

Hi.

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();

reportForm.loadParameters(params);

 

 

// Load and fill report

JasperReport report = (JasperReport)

JRLoader.loadObjectFromLocation(REPORT_DIR

+ 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

exporter.exportReport();

bos.flush();

 

JSP sourcecode:

<body>

<table width="100%">

<tr>

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

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

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

</nested:select>

<nested:select property="selectedKeyword">

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

</nested:select>

 

 

 

<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>

</tr>

<tr>

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

</tr>

 

</nested:form>

 

 

</body>

 

 

 

 

 

 

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...