英文:
Crystal report New line after detect 3 commas
问题
Crystal Report 在检测到 3 个逗号后换行
我有类似 "A,B,C,D,E,F,G" 的文本
我该如何编写代码?
我想要显示
A,B,C,
D,E,F,
G
英文:
Crystal report a New line after detecting 3 commas
I have Text like "A,B,C,D,E,F,G"
how could I code?
I would like to show
A,B,C,
D,E,F,
G
答案1
得分: 0
请看以下代码:
尝试这个:
local numbervar counter := 0;
local stringvar result := ""
local numbervar i;
For i := 1 to Len({@yourText}) do
(
IF {@yourText}[i] <> "," Then result := result + {@yourText}[i];
IF {@yourText}[i] = "," Then
IF counter = 2 THEN
(counter := 0;
result := result + CHR(10) + CHR(13);)
ELSE
(counter := counter + 1;
result := result + {@yourText}[i];) ;
);
result;
英文:
Try this:
local numbervar counter := 0;
local stringvar result := "";
local numbervar i;
For i := 1 to Len({@yourText}) do
(
IF {@yourText}[i] <> "," Then result := result + {@yourText}[i];
IF {@yourText}[i] = "," Then
IF counter = 2 THEN
(counter := 0;
result := result + CHR(10) + CHR(13);)
ELSE
(counter := counter + 1;
result := result + {@yourText}[i];) ;
);
result;
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论