Skip to content

Instantly share code, notes, and snippets.

@ivanursul
Created March 25, 2015 14:56
Show Gist options
  • Select an option

  • Save ivanursul/d951ce3f0224055ec91e to your computer and use it in GitHub Desktop.

Select an option

Save ivanursul/d951ce3f0224055ec91e to your computer and use it in GitHub Desktop.
CustomReportDocxExporter.java for www.ivanursul.com
package org.jasper.exporter;
import java.util.Map;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.export.ooxml.JRDocxExporter;
import org.springframework.webflow.execution.RequestContext;
import com.jaspersoft.jasperserver.api.common.domain.ExecutionContext;
import com.jaspersoft.jasperserver.war.action.ReportDocxExporter;
@SuppressWarnings({"unchecked", "rawtypes"})
public class CustomReportDocxExporter extends ReportDocxExporter {
@Override
public void export(final RequestContext context, final ExecutionContext executionContext, final String reportUnitURI, final Map baseParameters) throws JRException {
JRDocxExporter exporter = new CustomDocXExporter(getJasperReportsContext());
exporter.setParameters(baseParameters);
exporter.exportReport();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment