There is no source file. I am building the excel sheet from scratch. Also I can't post in the whole functions, they are very long. I have pasted in the relevant code. tagNames is a very long list of values and it just truncates instead of wrapping. I do hope yo can make sens of what I have posted.
// Creating a file input stream to reference the license file
// Create a License object
com.aspose.cells.License lic = new com.aspose.cells.License();
ServletContext sc = session.getServletContext();
String basePath = sc.getRealPath("/");
// Set the license of Aspose.Cells
lic.setLicense(new FileInputStream(new File(basePath
+ "\\resources\\Aspose.Total.Java.lic")));
// Instantiate a Workbook object that represents Excel file.
Workbook wb = new Workbook();
int styleIdx = wb.getStyles().add();
Style tableHeadStyle = wb.getStyles().get(styleIdx);
tableHeadStyle.getFont().setColor(com.aspose.cells.Color.getBlack());
tableHeadStyle.getFont().setBold(true);
tableHeadStyle.setPattern(BackgroundType.SOLID);
tableHeadStyle.setForegroundColor(com.aspose.cells.Color.getLightGray());
tableHeadStyle.setHorizontalAlignment(TextAlignmentType.LEFT);
tableHeadStyle.setTextWrapped(true);
tableHeadStyle.setBorder(BorderType.BOTTOM_BORDER, CellBorderType.THIN, Color.getBlack());
tableHeadStyle.setBorder(BorderType.TOP_BORDER, CellBorderType.THIN, Color.getBlack());
tableHeadStyle.setBorder(BorderType.LEFT_BORDER, CellBorderType.THIN, Color.getBlack());
tableHeadStyle.setBorder(BorderType.RIGHT_BORDER, CellBorderType.THIN, Color.getBlack());
styleIdx = wb.getStyles().add();
Style tableDataStyle = wb.getStyles().get(styleIdx);
tableDataStyle.setHorizontalAlignment(TextAlignmentType.LEFT);
tableDataStyle.setTextWrapped(true);
tableDataStyle.setBorder(BorderType.BOTTOM_BORDER, CellBorderType.THIN, Color.getBlack());
tableDataStyle.setBorder(BorderType.TOP_BORDER, CellBorderType.THIN, Color.getBlack());
tableDataStyle.setBorder(BorderType.LEFT_BORDER, CellBorderType.THIN, Color.getBlack());
tableDataStyle.setBorder(BorderType.RIGHT_BORDER, CellBorderType.THIN, Color.getBlack());
String tagN = tagNames.toString();
tagN = tagN.replace("[", "");
tagN = tagN.replace("]", "");
// Note when you create a new workbook, a default worksheet
// "Sheet1" is added (by default) to the workbook.
// Access the first worksheet "Sheet1" in the book.
Worksheet sheet = wb.getWorksheets().get(0);
sheet.setName("Order Entry Report");
sheet.setGridlinesVisible(true);
PageSetup ps = sheet.getPageSetup();
String script1 = "&\"Arial, Bold\"&14&K1F69AA&A";
ps.setHeader(0, script1);
ps.setFooter(0, "&G");
FileInputStream fis = new FileInputStream(basePath + "\\resources\\images\\driSteem_logo_footer.png");
byte[] picData = new byte[fis.available()];
fis.read(picData);
ps.setFooterPicture(0, picData);
String footString = "Generated by driCalc® software, Version 4.00.00 on &D-&T";
ps.setFooter(2, "&\"Arial\"&K222222&8 " + footString + " &\"Arial\"&K1F69AA&8 | &P of &N");
sheet.setGridlinesVisible(true);
sheet.autoFitRows(true);
Cells cells = sheet.getCells();
cells.setColumnWidth(0, 25f);
cells.setColumnWidth(1, 60f);
sheet.autoFitRows(true);
WorksheetCollection worksheets = wb.getWorksheets();
int sheetIndex;
int counter = 0;
int i = 0;
for(Integer systemId : systemList)
{
oe = dao.findById(systemId);
counter++;
if(oe != null && counter == 1)
{
i = populateProjectInformtaion(cells, oe, tableHeadStyle, tableDataStyle, unitOfMeasure, tagN);
}
sheetIndex = worksheets.add();
sheet = worksheets.get(sheetIndex);
if(oe != null && oe.getTagName() != null && oe.getTagName().length() <= 27)
{
sheet.setName("OER " + oe.getTagName());
}
else if(oe != null && oe.getTagName() != null)
{
sheet.setName("OER " + oe.getTagName().substring(0, 26));
}
sheet.setGridlinesVisible(true);
sheet.autoFitRows(true);
ps = sheet.getPageSetup();
ps.setHeader(0, script1);
ps.setFooter(0, "&G");
fis.read(picData);
ps.setFooterPicture(0, picData);
ps.setFooter(2, "&\"Arial\"&K222222&8 " + footString + " &\"Arial\"&K1F69AA&8 | &P of &N");
sheet.setGridlinesVisible(true);
cells = sheet.getCells();
cells.setColumnWidth(0, 20f);
cells.setColumnWidth(1, 15f);
cells.setColumnWidth(2, 5f);
cells.setColumnWidth(3, 12f);
cells.setColumnWidth(4, 12f);
cells.setColumnWidth(5, 4f);
cells.setColumnWidth(6, 10f);
sheet.autoFitRows();
.................................................
private int populateProjectInformtaion(Cells cells, OrderEntry oe, Style tableHeadStyle, Style tableDataStyle, String unitOfMeasure, String tagNames)
..............................................................................