Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Count Returns/Chr(10) in Field Post Reply Post New Topic
Author Message
vzh101
Groupie
Groupie
Avatar

Joined: 12 Feb 2015
Location: United States
Online Status: Offline
Posts: 46
Quote vzh101 Replybullet Topic: Count Returns/Chr(10) in Field
     Posted: 15 May 2015 at 5:29am
Is there a formula that count number of lines or Returns (Chr(10))?

I have a field that have large sentence and paragraphs and I want to count the lines of each sentence or return Chr(10).

Thanks!
IP IP Logged
Erik
Groupie
Groupie
Avatar

Joined: 05 Dec 2013
Online Status: Offline
Posts: 50
Quote Erik Replybullet Posted: 19 May 2015 at 5:38am
Here is a basic formula that will count carraige returns. If you need to actually count how many rows you are using, as in where the cell pops text on to the next line, that will depend on the width of the cell and gets kind of tricky.

local numberVar strLen := len({call_req.description});
local numberVar loopVar := 1;
local numberVar CRCount;

for loopVar := 1 to strLen do
(
  if mid({call_req.description}, loopVar, 1) = chr(10) then
  CRCount := CRCount + 1
);

CRCount

IP IP Logged
CoSpringsguy
Newbie
Newbie
Avatar

Joined: 18 May 2015
Online Status: Offline
Posts: 1
Quote CoSpringsguy Replybullet Posted: 20 May 2015 at 3:22pm
ubound(split({call_req.description},chr(10)))
IP IP Logged
Printable version Printable version

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