数据格式为double , int ,decimal 类型的数据  导出到excel 就成为文本类型了
     
   

解决方案 »

  1.   

    你看看可以不可以设置cloumns 的type 咯.这几天正在调查这个东西...就是求一个表的像素的..整不出来不对..
      

  2.   


    官方有例子 下下来看了的  貌似是DLL版本问题  没搞懂那里设置的
      

  3.   

    mybook.Worksheets[0].Cells[1, 3].Type = CellValueType.IsNumeric;
    这样一个一个去设置,,,不可行....
      

  4.   


    都试过了 有个style.Custom = cells[i, 2].StringValue; 这个是转化string http://www.aspose.com/docs/display/cellsnet/Importing+Data+to+Worksheets
    上面是官方的例子  不知道弄的数据出来 还有DLL的版本也不同了 
      

  5.   

      还是老外给力啊 在官方论坛  搜了下  无限找帮助
      做个几号,方便以后人用 能解决
      
               //Adding a numeric value to "A2" cell
                string a = "100";
                worksheet.Cells["A2"].PutValue(a, true);   --主要是这个,增加一个参数,一般不会用到            //Getting the Style of the A2 Cell
                style = worksheet.Cells["A2"].GetStyle();            //Setting the display format to number 9 to show value as percentage
                style.Number = 1;  -- 这个Number设置 官方有API可以看到 相应的设置            //Applying the style to the A2 cell
                worksheet.Cells["A2"].SetStyle(style);
       
      

  6.   

    看看你的版本 worksheet.Cells["A2"].PutValue(Datetime.Now); 这个有问题木有,我就这样有问题....
    还有 就是 mybook.Worksheets[0].Cells[1, 3].Type这个type 是不是只读的..
      

  7.   

    这个用style来设置 好多问题啊.什么背景颜色前景颜色,字体位置什么的...么得效果.难道我用错了...
      

  8.   

    style 可以用来设置CELL的 上面那段测试只是设置的显示数据格式
    和背景 字体什么的没关系 这个可以另外设置还有你检查下DLL的版本 网上下的有可能比较老
    到官方应该是最新 的7.几版本