我怎样才能将数字值从C#传递到Excel工作表 [英] How can i pass numeric vales to the excel sheet from c#

查看:85
本文介绍了我怎样才能将数字值从C#传递到Excel工作表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


当我通过SQL将值从C#应用程序传递到excel电子表格时,这是一个问题,我传递的值没有像在Excel电子表格中那样显示,即数字例如65234451254是数字,但是在Excel工作表中(单元格中)显示为6.52E + 10.不对Excel工作表进行任何修改,如何获得相同的值(65234451254).

如果我们将字母数字值发送到excel工作表,则会显示该值,因为它是从应用程序传递来的值.但是我不想像这样传递值,我只是想要数字值.

请告诉我解决方法.
谢谢...
提前..

Hi,
Here is a problem when i am passing values to the excel spread sheet from the c# application through the SQL, the values which i am passing are not showing as it is in the excel spread sheet i.e, numbers for example 65234451254 is the number, but it''s showing in the excel sheet(in a cell) as 6.52E+10. Without making any modifications in the excel sheet how can i get the same value(65234451254).

If we send alphanumeric value to the excel sheet it is showing as it is the value which is passed from the application. But i don''t want to pass the vales like that, i just want numeric values as it is.

Please tell me the solution.
Thank you...
in advance..

推荐答案

打开Excel工作表时,您应该能够扩展excel列以显示整数.如果要在Excel(列宽)上有更多控件,则需要使用Excel Interopt或第三方控件(例如ExcelWriter).我知道,如果您正在使用ASP.NET或在服务器上执行此操作,则无法在Excel中打开Excel电子表格.
When you open the Excel Sheet, you should be able to expand the excel column to show the whole number. I you want more control on Excel (Column width), you will need to use the Excel Interopt, or a third party control such as ExcelWriter. I know that if you are using ASP.NET, or doing this on a server, you cannot open an excel spreadsheet in Excel.


这篇关于我怎样才能将数字值从C#传递到Excel工作表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆