public JRDataSource createDatasource() throws JRException {
try {
Workbook workbook = (Workbook) getParameterValue(JRXlsQueryExecuterFactory.XLS_WORKBOOK);
if (workbook != null) {
datasource = new JRXlsDataSource(workbook);
} else {
InputStream xlsInputStream = (InputStream) getParameterValue(JRXlsQueryExecuterFactory.XLS_INPUT_STREAM);
if (xlsInputStream != null) {
datasource = new JRXlsDataSource(xlsInputStream);
} else {
File xlsFile = (File) getParameterValue(JRXlsQueryExecuterFactory.XLS_FILE);
if (xlsFile != null) {
datasource = new JRXlsDataSource(xlsFile);
} else {
String xlsSource = getStringParameterOrProperty(JRXlsQueryExecuterFactory.XLS_SOURCE);
if (xlsSource != null) {
datasource = new JRXlsDataSource(xlsSource);
} else {
if (log.isWarnEnabled()){
log.warn("No XLS source was provided.");
}
}