Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count of lines

Status
Not open for further replies.

mimiotoko

MIS
Apr 10, 2003
17
DE
Hi all,
how can I count the lines of a details-field. I allowed the field to grow as much as needed. But if there are too many lines it will destroy my layout.

In the area-assistant I marked "new page after" with this formular:
not onlastrecord and (#lfdsumme) in [10,20,30...]

It works fine. Only the cause of too many lines is my problem. So I need a formular who counts the lines of the details-fields.

thanks and regards
Rainer
 
If you are willing to use a true type font (I think that's what they are called) like Courier, where each letter takes the same amount of space, you could determine on which number of spaces the field "grows" on. If the "return" occurs after 15 characters/spaces, then you could use a formula like {@lines}:

whileprintingrecords;
numbervar lenx;
numbervar counter := counter + 1;

if len({table.string}) > 15 then lenx := lenx + 1;
counter + lenx;

Create another formula {@reset} and place it in the page footer:

whileprintingrecords;
numbervar lenx := 0;
numbervar counter := 0;

Then use {@lines} in your "new page after" formula:

{@lines} >= 10

This will give you a page break for every 10 or 11 lines if the maximum lines per growing field are two. You would have to play with this if your details could grow more than two lines.

-LB
 
This is Crystal version dependent, please at least post your version number.

A row count is simple, a line count is not.

You might estimate the number of lines, but are you speaking of the number of lines per details, or?

Check the length of the field and divide by the number of characters per line that you're allowing (probabl;y a proportional font so it would be inexact).

Also you might describe why the number of lines "destroys your layout", perhaps there's a better way to implement.

-k
 
All right!
At first the version is CR 8.5

Yes indeed I'm speaking about the number of lines per details.

"Also you might describe why the number of lines "destroys your layout", perhaps there's a better way to implement."

That is the problem. I'll try it. At the right bottom of the page is a logo implemented. The details-files need the complete page. Thats the reason why I have to limit my details-fields. At first I tried it with some site-foots, but it doesn't work.

"Check the length of the field and divide by the number of characters per line that you're allowing"

I allow as much characters as fit in this field. It may grow if possible.

I hope you understand my problem.

sorry, beause of my great AE ;-))

regards rainer
 
I don't know what a site-foot is. Did you try placing the logo in the page footer? That should work.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top