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); 
    

      

  • 相关阅读:
    模块
    time/datetime/random/string/os/sys/shutil/zipfile/tarfile
    模块
    模块
    模块
    2.1
    1.4
    生成器 迭代器
    闭包 装饰器
    函数
  • 原文地址:https://www.cnblogs.com/liweis/p/10137637.html
Copyright © 2011-2022 走看看