I do not speak English.
Google Translate, the article, so please understand less.
I have the ability to download Excel I’m writing in Eclipse.
However, two lines after the title in the fields that need to, I’ve used as follows
mygrid.setHeader("maintitle1,#cspan,#cspan,#cspan,#cspan,#cspan,maintitle2,#cspan,#cspan");
mygrid.attachHeader(["title1","title2","long title<br/>(very long<br/>long title)","title3<br/>(Explanation)","title4","title5","title6","title7","title8"]);
If you use two lines shown in the grid so.
If you press the download button but excel in one line is truncated to fit the length of the grid shown.
I wanted to solve was using jxl to setWarp in.
(ExcelWriter.java)
private void headerPrint(ExcelXmlParser parser) throws RowsExceededException, WriteException, IOException {
cols = parser.getColumnsInfo("head");
int widths[] = parser.getWidths();
this.cols_stat = widths.length;
int sumWidth = 0;
for (int i = 0; i < widths.length; i++) {
sumWidth += widths[i];
}
if (parser.getWithoutHeader() == false) {
for (int i = 0; i < cols.length; i++) {
sheet.setRowView(i, 450);
sheet.getSettings().setVerticalFreeze(i + 1);
for (int j = 0; j < cols[i].length; j++) {
sheet.setColumnView(j, widths[j]*scale/sumWidth);
WritableFont font = new WritableFont(WritableFont.TAHOMA, 10, WritableFont.BOLD);
font.setColour(colors.getColor(headerTextColor, wb));
WritableCellFormat f = new WritableCellFormat (font);
f.setBackground(colors.getColor(bgColor, wb));
f.setBorder(Border.ALL, BorderLineStyle.THIN, colors.getColor(lineColor, wb));
f.setVerticalAlignment(VerticalAlignment.CENTRE);
//this warp f.setWrap(true);
f.setAlignment(Alignment.CENTRE);
String name = cols[i][j].getName();
Label label = new Label(j, i, name, f);
sheet.addCell(label);
colsNumber = j;
}
}
headerOffset = cols.length;
for (int i = 0; i < cols.length; i++) {
for (int j = 0; j < cols[i].length; j++) {
int cspan = cols[i][j].getColspan();
if (cspan > 0) {
sheet.mergeCells(j, i, j + cspan - 1, i);
}
int rspan = cols[i][j].getRowspan();
if (rspan > 0) {
sheet.mergeCells(j, i, j, i + rspan - 1);
}
}
}
}
}
However, unlike poi
tags \ n tag was not read the same thing, just two lines to fit the length slot with three lines long, have a line break.
I am still on the grid by adjusting only the length but I thought it was not going to any problem, the length is too long (ex: “,” long title
(very long
long title) ")
When multiline been discarded as being fixed in height in Excel being clipped out.
When I download excel only in the subject line breaks and accordingly, even moderately high and wants to come out.
plz help me! thank you