我的用法
sheet.setRowView(5,60,false);Label label0 = new Label(0, 5, "豆豆"); 
sheet.addCell(label0); 
Label label1 = new Label(1, 5, "小豆子"); 
sheet.addCell(label1); 想把Excel第五行的高度设为 60
可是不管我用
sheet.setRowView(5,60);
还是sheet.setRowView(5,60,true);
以及sheet.setRowView(5,60,false);第五行的高度都是很小的,连里面的内容都看不到,请问题出在哪里.
肯请各位高手给指点一下,最好有代码示例一下!

解决方案 »

  1.   

    你可以设置高一点。给你段代码参考一下:import java.io.File;
    import jxl.Workbook;
    import jxl.write.Label;
    import jxl.format.Colour;
    import java.io.IOException;
    import jxl.write.WritableFont;
    import jxl.write.WritableSheet;
    import jxl.write.WriteException;
    import jxl.format.UnderlineStyle;
    import jxl.write.WritableWorkbook;
    import jxl.read.biff.BiffException;
    import jxl.format.Alignment;
    import jxl.format.VerticalAlignment;
    import jxl.format.BorderLineStyle;
    import jxl.format.Border;public class TestConfigStyle {  public static void main(String args[]) {    WritableWorkbook book = null;    try {
          //Excel获得文件
          Workbook wb = Workbook.getWorkbook(new File("测试.xls"));      //打开一个文件的副本,并且指定数据写回到原文件
          book = Workbook.createWorkbook(new File("测试.xls"), wb);      //添加一个工作表
          WritableSheet sheet = book.createSheet("f",5);      WritableFont wf = new WritableFont(WritableFont.createFont("华文新魏"), 18,
                                             WritableFont.BOLD, true,
                                             UnderlineStyle.NO_UNDERLINE,
                                             Colour.PINK2);
          jxl.write.WritableCellFormat wcfF = new jxl.write.WritableCellFormat(wf);
          wcfF.setAlignment(Alignment.GENERAL);
          wcfF.setVerticalAlignment(VerticalAlignment.CENTRE);
          wcfF.setWrap(true);
          wcfF.setBorder(Border.TOP,BorderLineStyle.MEDIUM_DASH_DOT_DOT,Colour.ORANGE);
          jxl.write.Label label = new jxl.write.Label(2, 2, "Merry Christmas !",
                                                      wcfF);
          sheet.setRowView(2,3000,false);
          sheet.setColumnView(2,80);
          sheet.addCell(label);      book.write();
        }
        catch (IOException ioe) {
          ioe.printStackTrace();
        }
        catch (BiffException be) {
          be.printStackTrace();
        }
        catch (WriteException we) {
          we.printStackTrace();
        }
        finally {      try {
            if (book != null) {
              book.close();
            }
          }
          catch (IOException ioe) {
            ioe.printStackTrace();
          }
          catch (WriteException we) {
            we.printStackTrace();
          }
        }
      }
    }ok了~
      

  2.   

    原来是自己的高度设得太小了,谢了各位..知道jxl.sheetsettings()的朋友也帮一下,给些示例代码,分数可以另外开贴给的...
      

  3.   

    这个比较高深,要不这样,我自己做了一套chm的jxl帮助文档。(E文的),把信箱留给我,发给你研究研究吧
      

  4.   

    谢谢 nego_sun_java(稽姬) 最好能给些sheetsettings()的代码示例,我的java基础知识学得不好,这些类之间的东东搞不大清楚...