我正在使用Silverlight4和Telerik Reporting Q3 2011.我正在尝试生成所有插座的报告。我用Table来显示它的字段。我想在同一个单元格中显示完整地址。我怎么能?
我使用Experession在同一个单元格中显示完整地址。
= Fields.AddressLine1
+ ", " + Fields.AddressLine2
+ ", " + Fields.Suburb
+ ", " + Fields.City
+ ", " + Fields.State
+ ", " + Fields.Country
我想在同一个单元格中显示它,但想要输出如下..
=====================
Address
=====================
15A,
xxxx xxxRoad,
xxxxxx,
xxxxxxxx
====================
但我得到了这个
=====================
Address
=====================
15A, xxxx xxxRoad, xxxxxx, xxxxxxxx
=====================
如何获得我想要的输出?
答案 0 :(得分:3)
在这个函数中创建函数NewLineFeeds()我使用Replace()方法将特定字符串替换为newLine(\ n)。
public static string NewLineFeeds(string text)
{
string result = text.Replace(", ", "\n");
result = result.Replace(", ", "\n");
result = result.Replace(", ", "\n");
return result;
}
我的表达是
=NewLineFeeds(Fields.AddressLine1
+ ", " + Fields.AddressLine2
+ ", " + Fields.Suburb
+ ", " + Fields.City
+ ", " + Fields.State
+ ", " + Fields.Country)
这将调用函数NewLineFeeds()并将“,”替换为\ n(新行)。添加这将工作正常..