code: static Workbook toWorkbook(final IDataModel dataModel, final Workbook formatting) {
          Workbook result = formatting == null ? ConverterUtils.newWorkbook() : ConverterUtils.clearContent(formatting);
  
          Sheet wbSheet = result.getSheet(dataModel.getName());
          if (wbSheet == null) { wbSheet = result.createSheet(dataModel.getName()); }
  
          dataModel.getNamedAddresses().forEach((k, v) -> {
              Name name = result.createName();
              name.setNameName(k);
              
              name.setRefersToFormula(createPoiNameRef(v.address(), dataModel.getName()));
          });
  
          dataModel.getNamedValues().forEach((k, v) -> {
              Name name = result.createName();
              name.setNameName(k);
              
              String refString = v.get() == null ? "" : v.get().toString();
              if (refString.startsWith(FORMULA_PREFIX)) { refString = refString.substring(1); }
              
              name.setRefersToFormula(refString);
          });
  
          for (int rowIdx = dataModel.getFirstRowIndex(); rowIdx <= dataModel.getLastRowIndex(); rowIdx++) {
              IDmRow dmRow = dataModel.getRow(rowIdx);
              if (dmRow == null) { continue; }
              Row wbRow = wbSheet.getRow(rowIdx);
              if (wbRow == null) { wbRow = wbSheet.createRow(rowIdx); }
              
              for (int cellIdx = dmRow.getFirstColumnIndex(); cellIdx <= dmRow.getLastColumnIndex(); cellIdx++) {
                  IDmCell dmCell = dmRow.getCell(cellIdx);
                  if (dmCell == null) { continue; }
                  
                  Cell wbCell = wbRow.getCell(cellIdx);
                  if (wbCell == null) { wbCell = wbRow.createCell(cellIdx); }
                  
                  ConverterUtils.populateCellValue(wbCell, dmCell.getContent());
              }
          }
  
          return result;
      }
docs: Convertes plain {@link IDataModel} to new {@link XSSFWorkbook} with formatting provided.