XtraReport中,为XrTableCell赋值,数据类型是字符串
在数据源中加入换行符"\r\n",例如:“这是第一行\r\n这是第二行\r\n这是第三行”
运行显示后并不是显示三行,没有在换行符处换行,只是到了XrTableCell边界时触发了自动换行
用什么方法才能让“\r\n”生效?
PS:把同样的字符串扔到WinFrom中的label中就自动换行了,数据源应该没问题
我以前做过一个例子实现了在XrTableCell中通过换行符换行,这两天再用就发现不行了
求解决方案
不用换行符也可以,有没有控制换行的方法?
xrtablecell 换行问题 DEV控件 C#
答案:3 悬赏:10 手机版
解决时间 2021-04-07 11:23
- 提问者网友:酱爆肉
- 2021-04-06 15:22
最佳答案
- 五星知识达人网友:长青诗
- 2021-04-06 16:04
一老外对换行的解释
\n = CR (Carriage Return) // Used as a new line character in Unix
\r = LF (Line Feed) // Used as a new line character in Mac OS
\n\r = CR + LF // Used as a new line character in Windows
(char)13 = \n = CR // Same as \n
Environment.NewLine = any of the above code based on the operating system
// .Net provides the Environment class which provides many data based on Operating Systems, so if the application is built in Windows, and you use CR + LF ("\n\r" instead of Environment.NewLine) as new line character in your strings, and then MS creates a VM for running .Net applications in Unix, then there will be problem. So, you should always use Environment.NewLine when you want a new line character.
试一下这几个,看看有没有行得通的
\n = CR (Carriage Return) // Used as a new line character in Unix
\r = LF (Line Feed) // Used as a new line character in Mac OS
\n\r = CR + LF // Used as a new line character in Windows
(char)13 = \n = CR // Same as \n
Environment.NewLine = any of the above code based on the operating system
// .Net provides the Environment class which provides many data based on Operating Systems, so if the application is built in Windows, and you use CR + LF ("\n\r" instead of Environment.NewLine) as new line character in your strings, and then MS creates a VM for running .Net applications in Unix, then there will be problem. So, you should always use Environment.NewLine when you want a new line character.
试一下这几个,看看有没有行得通的
全部回答
- 1楼网友:时间的尘埃
- 2021-04-06 17:19
要把 multiline 打上勾
再看看别人怎么说的。
- 2楼网友:醉吻情书
- 2021-04-06 16:21
楼主可解决了嘛
我也遇到同样的问题
麻烦支招 谢谢
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯