找回密码
 立即注册

QQ登录

只需一步,快速开始

xue海飘香

中级会员

6

主题

8

帖子

716

积分

中级会员

积分
716

活字格认证

xue海飘香
中级会员   /  发表于:2014-10-24 20:02  /   查看:4493  /  回复:1
将spread中的数据导出到excel表格中后,excel表格的列怎样设为数值型。现在已经做了以下处理但是导出的excel表格中的格式是自定义,不是数值型,不知道为什么,求大神帮忙
     With excelSpread.Sheets(0)
            Dim len = Me.m_strDataFields.Length
            Dim numCell As New FarPoint.Win.Spread.CellType.NumberCellType()
            numCell.DecimalPlaces = 0
            For i As Integer = 15 To len - 1
                If (i <> Me.m_strDataFields.Length - 9) Then
                    .Columns(i).CellType = numCell
                End If
            Next i
        End With

1 个回复

倒序浏览
iceman
社区贡献组   /  发表于:2014-10-27 18:52:00
沙发
回复 1楼xue海飘香的帖子

请问您使用的 spread 版本是?我这边使用 Spread for WinForms 7.0V4 测试,通过1#可以正常导出NumberCellType到excel。
保存代码:

  1.         Me.excelSpread.SaveExcel(&quot;test.xlsx&quot;, FarPoint.Excel.ExcelSaveFlags.UseOOXMLFormat)
复制代码


下载地址:
http://www.gcpowertools.com.cn/d ... SpreadforWin7v4.zip

评分

参与人数 1满意度 +5 收起 理由
xue海飘香 + 5

查看全部评分

回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部