zoukankan      html  css  js  c++  java
  • Aspose.Cells设置单元格格式

    使用Aspose.Cells操作Excel时,填写的参数是这样的,显然要不得!

    这需要像Excel中的“转换为数字”操作,强大的Aspose.Cells可轻松解决这个问题。

    //默认写法
    worksheet.Cells["A1"].PutValue(10);  
    worksheet.Cells["A1"].PutValue("10"); 
    
    //转为化数字
    worksheet.Cells["A1"].PutValue(10,true);  
    worksheet.Cells["A1"].PutValue("10",true); 
    
    //设置单元格格式
    Style  style = worksheet.Cells["A1"].GetStyle();
    style.Number = 1;
    worksheet.Cells["A1"].SetStyle(style);
    
    //填充并设置单元格格式
    worksheet.Cells["A1"].PutValue("10",true,style); 
    

      

  • 相关阅读:
    RTP/RTSP编程
    makefile
    VS 2010内存泄漏检测
    Linux Shell中捕获CTRL+C
    const
    Hdu 5344
    Hdu5762
    CF1200C
    CF1200B
    CF1200A
  • 原文地址:https://www.cnblogs.com/liweis/p/10137637.html
Copyright © 2011-2022 走看看