I am new to crystal reports. I am trying to count lines in crystal rpt. I want to know how to count 65 characters per line, and we count key stroke here also counting headers. Please please help!
I am using CR 10. I have a report that lists a text field in multiple lines. I need this column on the report to only list 65 characters per line, and then I need to somehow count the number of lines printed for each ID. The formula i am using is below But i get text instead of number of lines.
shared numberVar RowsThisRecord;
stringVar Result;
numberVar RowCount := int((len({MEDICAL_REPORT_OBJECT.MRO_TEXT}) / 65)+0.99999);
RowsThisRecord := RowCount;
numberVar i;
for i := 1 to RowCount do
(
Result := Result + mid({MEDICAL_REPORT_OBJECT.MRO_TEXT},(i*65) - 64, 65) + chr(10);
);
Result;
Hi,
You get text because you are returning the stringVar ( Result) which is just the chr(10) separated text, not a count of how many times it was used..
Maybe return RowCount instead of Result..
To Paraphrase:"The Help you get is proportional to the Help you give.."
Now I get an error when i tried below farmula. Any other Suggestions.I am new to this so bear with me.
numberVar RowsThisRecord;
stringVar Result;
numberVar RowCount := int((len({MEDICAL_REPORT_OBJECT.MRO_TEXT}) / 65)+0.99999);
RowsThisRecord := RowCount;
numberVar i;
for i := 1 to RowCount do
(
RowCount := Result + mid({MEDICAL_REPORT_OBJECT.MRO_TEXT},(i*65) - 64, 65) + chr(10);
);
RowCount;
synapsevampire, Now it showes the number of line in last text field only. It skiped 13 text fields and counted only the 14th text field which has 7 lines and it is correct! But what about the other 13. Also is there a way to to count the grand total of all text field.
Thanks for the help!
Don't say "I get an error", state what the error said.
numberVar RowsThisRecord;
stringVar Result;
numberVar RowCount := int((len({MEDICAL_REPORT_OBJECT.MRO_TEXT}) / 65)+0.99999);
RowsThisRecord := RowCount;
numberVar i;
for i := 1 to RowCount do
(
Result := Result + mid({MEDICAL_REPORT_OBJECT.MRO_TEXT},(i*65) - 64, 65) + chr(10);
);
RowCount
I gave you a solution, which you promptly ignored. As a beginner you might want to wait on th rewrite until you
This formula now returns the rowcount, but not the text. That part of the formula is now pointless.
Please post specifics of what you want and where. My last post returned both, but I guess you didn't want that or whatever it is that made you decide to alter it.
synapsevampire, i followed with your solution and honestly didn't ignore it and thanks to you guys it showes how many line in each user text field. Thanks guys!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.