将Grid导出到Excel时在Excel中换行 [英] New Line in Excel while exporting Grid to Excel

查看:90
本文介绍了将Grid导出到Excel时在Excel中换行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个数据表,其中包含各种行和列.
在一栏中,我在两个单词之间添加了 \ n ,以使其在换行符中.
然后,我将此数据表分配给网格视图数据源并将其绑定,以后
我已将此网格视图导出到excel文件.我的问题是换行符(\ n)
不能反映在excel文件中.因此,请提供帮助或指导我在通过C#导出时在excel文件中添加新行.

谢谢&问候
Somu Jose

Hi,

I have a data table in which it contains various rows an columns.
In one column i have append \n between two words to get it in a new line.
Then i assign this data table to a grid view data source and binding it,Later
i have exported this grid view to a excel file.My problem is that the newline(\n)
is not reflecting in the excel file.So please help in this or guide me to put a new line in excel file while exporting it via C#.

Thanks & Regards
Somu Jose

推荐答案

尝试Environment.NewLine"\r\n".

我认为,在换行时,办公产品的使用较为繁琐,并且也需要一定的报酬.
Try either Environment.NewLine or "\r\n".

I think that the office products are a bit more pedantic when it comes to line feeds and it reqires a carrage return also.


这篇关于将Grid导出到Excel时在Excel中换行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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