logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
nimainship  
#1 Posted : Monday, August 1, 2022 6:24:04 AM(UTC)
nimainship

Rank: Newbie

Groups: Registered
Joined: 3/29/2022(UTC)
Posts: 7
Taiwan, Province Of China

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

epf  
#2 Posted : Tuesday, August 2, 2022 9:10:27 AM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,101
Switzerland

Thanks: 14 times
Was thanked: 183 time(s) in 176 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).
nimainship  
#3 Posted : Tuesday, August 2, 2022 9:51:21 AM(UTC)
nimainship

Rank: Newbie

Groups: Registered
Joined: 3/29/2022(UTC)
Posts: 7
Taiwan, Province Of China

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

nimainship  
#4 Posted : Wednesday, August 3, 2022 7:06:41 AM(UTC)
nimainship

Rank: Newbie

Groups: Registered
Joined: 3/29/2022(UTC)
Posts: 7
Taiwan, Province Of China

Thanks: 2 times
That problem has been solved,
I find useful method for me.
Best regards
epf  
#5 Posted : Wednesday, August 3, 2022 8:04:36 AM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,101
Switzerland

Thanks: 14 times
Was thanked: 183 time(s) in 176 post(s)
good, can you share your solution please ?
nimainship  
#6 Posted : Wednesday, August 3, 2022 9:32:37 AM(UTC)
nimainship

Rank: Newbie

Groups: Registered
Joined: 3/29/2022(UTC)
Posts: 7
Taiwan, Province Of China

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

Users browsing this topic
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.