fixed JasperReports exporter parameter initialization for multi-format views

This commit is contained in:
Juergen Hoeller
2009-04-15 23:18:57 +00:00
parent 310a3a2d71
commit d27cbee69c
5 changed files with 326 additions and 297 deletions

View File

@@ -255,6 +255,13 @@ public abstract class AbstractJasperReportsView extends AbstractUrlBasedView {
return this.exporterParameters;
}
/**
* Allows subclasses to populate the converted exporter parameters.
*/
protected void setConvertedExporterParameters(Map<JRExporterParameter, Object> convertedExporterParameters) {
this.convertedExporterParameters = convertedExporterParameters;
}
/**
* Allows subclasses to retrieve the converted exporter parameters.
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -183,13 +183,10 @@ public class JasperReportsMultiFormatView extends AbstractJasperReportsView {
}
AbstractJasperReportsView view = (AbstractJasperReportsView) BeanUtils.instantiateClass(viewClass);
// Copy appropriate properties across.
view.setExporterParameters(getExporterParameters());
// Can skip most initialization since all relevant URL processing
// has been done - just need to convert parameters on the sub view.
view.convertExporterParameters();
view.setExporterParameters(getExporterParameters());
view.setConvertedExporterParameters(getConvertedExporterParameters());
// Prepare response and render report.
populateContentDispositionIfNecessary(response, format);