}
// Inits the workbook and worksheet
UIWorkbook uiWorkbook = new UIWorkbook();
excelWorkbook.createWorkbook(uiWorkbook);
UIWorksheet uiWorksheet = new UIWorksheet();
uiWorkbook.getChildren().add(uiWorksheet);
uiWorksheet.setStyle(CSSParser.getStyle(dataTable));
uiWorksheet.setStyleClass(CSSParser.getStyleClass(dataTable));
excelWorkbook.createOrSelectWorksheet(uiWorksheet);
// Saves the datatable var
String dataTableVar = dataTable.getVar();
Object oldValue = FacesContext.getCurrentInstance().getExternalContext().getRequestMap().get(dataTableVar);
// Processes the columns
List<javax.faces.component.UIColumn> columns = ExcelComponent.getChildrenOfType(dataTable.getChildren(), javax.faces.component.UIColumn.class);
columnWidths = parseColumnWidths(uiWorksheet);
int col = 0;
for (javax.faces.component.UIColumn column : columns)
{
ColumnStyle columnStyle = new ColumnStyle(parser.getCascadedStyleMap(column));
boolean cssExport = columnStyle.export == null || columnStyle.export;
if (column.isRendered() && cssExport)
{
uiWorksheet.getChildren().add(column);
Iterator iterator = UIWorksheet.unwrapIterator(dataTable.getValue());
processColumn(column, iterator, dataTableVar, col++);
excelWorkbook.nextColumn();
}
}