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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to have consistent layout of records. How to force # of lines

Status
Not open for further replies.

MAT2001

Technical User
Feb 22, 2001
20
CA
Fairly new at Crystal Reports and need to ensure consistent placement of data on forms. Have a group header and details area where the records data grows. Need to be able to ensure that recoreds fill data down report two lines at a time, such that if the record takes up three lines the fourth would be blank.

Eg.

LINE Description Amount
---------------------------------------
Main Part
#55533-3333
---------------------------------------
0003334 Knock Pin 35.00

---------------------------------------
0003335 Lock Washer 22.00
Drawing D100
----------------------------------------
Engine System
Ref# 554-4444
type DD-3333

----------------------------------------
0003336 Washer Unit 33.00

----------------------------------------

Any suggestions would be appreciated.

 
Is the line wrapping because of the "Can Grow" feature?

If so, I think you might be stuck. I don't think there is any way for you to check for how many lines it has wrapped. So I can't think of a way to tell if it is even or odd or to force a new line.

Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
The field is set to grow, as the number of lines required per record will changed. Need to somehow tell it that if record has taken up odd number of pages to insert a blank!
 
ABOVE MESSAGE SHOULD READ

If record has taken up odd number of lines insert a blank!

sorry!
 
Does the wrapping occur because of the length of the field data, or because there are linefeed characters embedded in the text? Malcolm
 
The field is set to grow(wrap) and can occur because of the lenght of the field data and/or linefeed characters embedded in the text being pulled from the SQL database. The SQL field is set as alpha/numeric and has ability to be 255 characters in length.

So I need a method of controlling the record so that the lines used on the form are allows even to maintain the form layout, as when form is returned we have an OCR application that will read selected data fields.
 
That is unusual. Is there always either one or zero line feeds in the field? Malcolm
 
MAT2001: My only suggestions to resolve your problem are as follows:

1. First convert the line feeds in your data into full stops - Use Replace() function

2. Set Can Grow to a specific number of lines e.g. 11 - this will allow for up to 25 characters on each line but the last

3. Calculate approx. number of lines by Truncate(Length(field)/25)+ if Remainder((Length(field),25)>0 then 1

Problem with abov eapproach is that you would have to determine for the font in use how many characters will fit into available field display width and this will vary dependent upon font size, properties etc. David C. Monks
david.monks@chase-international.com
Accredited Seagate Enterprise Partner
 
The difficult issue I see here is the requirement for an even number of lines. If there is any pattern/logic to the linefeeds, there is likely a solution. Malcolm
 
Since this isn't a memo field, you could try to parse this into several formula fields - one for each line. The problem then would be not splitting the words.

I could envision a formula that looks for the next space and calculates if there is enough room for the word on the current line, and stops when the line is full. It would then put the balance on the next line till it was full, etc.

Once you have the text parsed into a known number of lines, you could do some logic to determine if you needed the pad line.

This is possible, but quite a bit of work. You can't do it relying on the wrap feature. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Wow thanks for all the suggestions! As a newbie I am still trying to figure this all out, and have limited programming skills. Will let you know how I do. Thanks for all your comments.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top