日期:2014-05-17 浏览次数:20831 次
<bean class="org.springframework.web.servlet.view.XmlViewResolver">
<property name="location" value="WEB-INF/jasper-views.xml"/>
<property name="order" value="0"/>
</bean>
<bean id="htmlReport" class="org.springframework.web.servlet.view.jasperreports.JasperReportsPdfView">
<property name="url" value="classpath:reportTest.jrxml"/>
</bean>
@Controller
public class BloodApplicationController {
@RequestMapping(value="/printApplicationForm")
public ModelAndView printApplicationForm(HttpServletRequest request, HttpServletResponse response){
logger.info("打印申请单");
Map<String, Object> model = new HashMap<String, Object>();
model.put(JasperReportsMultiFormatView.DEFAULT_FORMAT_KEY, "pdf");
return new ModelAndView("htmlReport", model);
}
}