Jasper download dialog not appear

Jaspersoft Community 'Read-Only' as of July 8, 2022

Transition to New TIBCO Community Just Weeks Away

You can still search, review wiki content, and review discussions in read-only mode. Please email community@tibco.com with questions or issues requiring TIBCO review or response.

Hello,
I have a problem with my java web application (WebLogic 10.3.5, Spring 3.1 and Jasper 5.0.1) I want to export an excel report, but at the end of operation, jasper download dialog not appear. In Tomcat AS everything works, but not in WebLogic.

Jsp code with export button:

<a title="Export" href="javascript:window.location.replace('<%=path %>/admin/export.com');">Export</a>

Spring MVC Controller:

@RequestMapping("/export.com")
public ModelAndView exportAction(@ModelAttribute("model") UserModel model, HttpServletRequest request) throws Exception{
    SearchBean searchForm = model.getSearchForm();
    Map<String,Object> parameterMap = new HashMap<String,Object>();
    List<User>usersList = iReportService.getUsers(searchForm,null).getResults();
    JRDataSource JRdataSource = new JRBeanCollectionDataSource(usersList);
    parameterMap.put("datasource", JRdataSource);
    return new ModelAndView("XlsUserReport",parameterMap);
}

pom.xml

<dependency>
    <groupId>net.sf.jasperreports</groupId>
    <artifactId>jasperreports</artifactId>
    <version>5.0.1</version>
    <exclusions>
        <exclusion>
            <groupId>xerces</groupId>
            <artifactId>xercesImpl</artifactId>
        </exclusion>
        <exclusion>
            <groupId>xml-apis</groupId>
            <artifactId>xml-apis</artifactId>
        </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>org.codehaus.groovy</groupId>
    <artifactId>groovy-all</artifactId>
    <version>1.7.0</version>
</dependency>
<dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi</artifactId>
    <version>3.6</version>
    <type>jar</type>
    <scope>compile</scope>
</dependency>

fe-servlet.xml

<bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
    <property name="viewClass">
        <value>org.springframework.web.servlet.view.tiles2.TilesView</value>
        <property name="order" value="1"/>
    </property>
</bean>
<bean class="org.springframework.web.servlet.view.XmlViewResolver">
    <property name="location" value="/WEB-INF/report.xml"/>
    <property name="order" value="0"/>
</bean>

report.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
    <bean id="XlsUserReport"
        class="org.springframework.web.servlet.view.jasperreports.JasperReportsXlsView"
        p:url="classpath:report/report/user.jrxml"
        p:reportDataKey="datasource">
        <property name="headers">
            <props>
                <prop key="Content-Disposition">
                    attachment; filename=users.xls
                </prop>
            </props>
        </property>
    </bean>
</beans>

In the same spring context I use two different resolver (UrlBasedViewResolver and XmlViewResolver) so maybe this can create problems.
As I said, in tomcat AS, jasper download dialog appear, but when I deploy my web application in WebLogic, after export click a blank page appear (the URL is .../export.com)

Fra83's picture
2
Joined: Oct 25 2013 - 2:02am
Last seen: 6 years 2 months ago

0 Answers:

No answers yet
Feedback