Seal Report Forum
»
Report Edition
»
Reports
»
How to according to ',' newline
Rank: Newbie
Groups: Registered
Joined: 3/29/2022(UTC) Posts: 7 Thanks: 2 times
|
Hello everyone I want to make my report field content wrap according to ',' EX: Original Data string > A,B,C,D become like this => A, B, C, D ex image link
What do I need to do Best regards. Edited by user Monday, August 1, 2022 8:26:31 AM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 12/20/2013(UTC) Posts: 1,209 Thanks: 14 times Was thanked: 206 time(s) in 199 post(s)
|
The simplest is to rely on you database engine to transform 1 record to several records using dedicated functions.... So this may depend on the type of your database (e.g. for MS SQLServer, just google: sql server split string into rows).
Another option is to rework your Result Set in a report task (Razor Script) and decode by C# and creates rows in the datatable (requires more C# and Seal Report skills).
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 3/29/2022(UTC) Posts: 7 Thanks: 2 times
|
Oh...I want it to wrap newline not split difference rows. Just like A,B,C,D => A\nB\nC\nD\n such an effect Can I use Advanced Cell script to handle this column? But I don't have any idea for this problem now. Edited by user Wednesday, August 3, 2022 2:46:29 AM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 3/29/2022(UTC) Posts: 7 Thanks: 2 times
|
That problem has been solved, I find useful method for me. Best regards
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 12/20/2013(UTC) Posts: 1,209 Thanks: 14 times Was thanked: 206 time(s) in 199 post(s)
|
good, can you share your solution please ?
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 3/29/2022(UTC) Posts: 7 Thanks: 2 times
|
I using Cell script to change the FinalValue. Not sure this method is correct or not. But it works for me. Code:@{
ResultCell cell = Model;
ReportElement element = cell.Element;
ReportModel reportModel = element.Model;
Report report = reportModel.Report;
if (!cell.IsTitle ){
cell.FinalCssStyle="white-space: nowrap";
string InputString = cell.Value.ToString();
var result = InputString.Replace(",", ",<br>");
cell.FinalValue = result;
}
}
Edited by user Wednesday, August 3, 2022 9:33:08 AM(UTC)
| Reason: Not specified
|
|
|
|
Seal Report Forum
»
Report Edition
»
Reports
»
How to according to ',' newline
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.