@Override
public String runReport(IViewerReportDesignHandle design, String outputDocName, InputOptions runOptions, Map parameters,
Map displayTexts, List<Exception> errorList) throws ReportServiceException {
if (design == null || design.getDesignObject( ) == null) {
throw new ReportServiceException(BirtResources.getMessage(ResourceConstants.GENERAL_EXCEPTION_NO_REPORT_DESIGN));
}
IReportRunnable runnable;
HttpServletRequest request = (HttpServletRequest) runOptions.getOption(InputOptions.OPT_REQUEST);
Locale locale = (Locale) runOptions.getOption(InputOptions.OPT_LOCALE);
TimeZone timeZone = (TimeZone) runOptions.getOption(InputOptions.OPT_TIMEZONE);
ViewerAttributeBean attrBean = (ViewerAttributeBean) request.getAttribute(IBirtConstants.ATTRIBUTE_BEAN);
// Set parameters
Map parsedParams = attrBean.getParameters();
if (parameters != null) {
parsedParams.putAll(parameters);
}
// Set display Text of select parameters
Map displayTextMap = attrBean.getDisplayTexts();
if (displayTexts != null) {
displayTextMap.putAll(displayTexts);
}
runnable = (IReportRunnable) design.getDesignObject();
try {
// get maxRows
Integer maxRows = null;
if (ParameterAccessor.isReportParameterExist(request, ParameterAccessor.PARAM_MAXROWS)) {
maxRows = Integer.valueOf(ParameterAccessor.getMaxRows(request));
}
try {
// put all app context from Birt Container to Report Engine Service
ReportEngineService.getInstance().getEngineConfig().getAppContext().putAll(
BirtContainer.getReportEngine().getConfig().getAppContext());
/*
--- DISABLE JDBC FEATURE
Connection connection = getConnection();
BirtContainer.getReportEngine().getConfig().getAppContext().put("OdaJDBCDriverPassInConnection", connection);
*/
} catch (Exception e) {
Debug.logError(e, module);
}
List<Exception> errors = this.runReport(request, runnable, outputDocName, locale, timeZone, parsedParams, displayTextMap, maxRows);
if (errors != null && !errors.isEmpty()) {
errorList.addAll(errors);
}
} catch ( RemoteException e ) {
if (e.getCause() instanceof ReportServiceException) {
throw (ReportServiceException) e.getCause();
} else {
throw new ReportServiceException(e.getLocalizedMessage(), e.getCause());
}
}
return outputDocName;
}