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!

Alignment problem

Status
Not open for further replies.

alvintse

Programmer
Aug 1, 2003
66
US
Hi,
I am using CR9 with sql server 2000.
I have placed a field in the report, say the size is 2 inches. The datatype for that field is string and can be a very long string. So I check the property can grow in order to display the whole string.
My problem is how can I check how many lines the string will wrap. I have to insert a carriage return to the field next to this to align the data properly
I tried counting the (length of the string)/number of character a single line can hold), and insert the carriage returns to the adjacent field accordingly.
That almost work except I forgot the whole word will wrap to another line if that won't fit within the line.
Any idea to deal with this?

Thanks.

Alvin
 
Count how many lines the second field would wrap by itself, and then insert as many carriage returns as needed to align it with the first fields. The number of carriage returns inserted would be the difference of lines the first field wraps into and the same for the second field. Use global variables to make the number from the first field available in the second one.
 
I had a similar problem trying to get a notes field to print correctly. The field was a blob type field.

I tried parsing the field, and inserting carriage returns,
but there was always a case where the word wrap or character spacing would make it not print like I wanted to.

I added another detail section and placed the field in it and set can grow on both the field and the section. And I suppressed both the field and the section if the notes field was null. Blobs cannot be referenced in formulas, but you can reference the blob field in an isnull formula.

Then the notes always printed correctly regardless of text spacing or length.

But the drawback to that was having the notes print after the columnar details.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top