My payment-slip printing form is limited in width, so I need to use rather narrow customer name and adress textboxes. Problem is that the textbox control “cuts off” the rest of the characters in a word that is too big for the row-width of the particular control, instead of spliting the word, and passing the rest of it to the new line - by wrapping the string. I tried to wrap it myself, but I can’t find the (pixels or 1/100mm) width property of each indiwidual character in control. Does such property exists ? How am I supposed to solve this pretty simple problem ? Thanx Amadeo
Hi, You will need to use the MultiLine property of the textbox control and set it to TRUE. And I think the property VertAlign will also be of interest then. Good luck
I forgot to mention that I’m already using the multiline property of the textbox control, it only transfers the next word to the new line, but it does not wrap the entire string, the last word in the problem line is being cut off !!! Amadeo
I’m not sure if I understand correctly. The textbox cannot be wider, but can’t you make it taller? Is this also problematic? If it doesn’t work then you must make a function to cut the name at a desired position, I have this is my archives [:D]: GetMaxLengthString(String : Text[250];MaxLength : Integer;LastCharacter : Text[1]) MaxLengthString : Text[250] MaxLengthString := String; IF (MaxLength > 0) AND (STRLEN(String) > MaxLength) THEN BEGIN LastCharacterPosition := MaxLength + 1; WHILE String[LastCharacterPosition] <> LastCharacter[1] DO LastCharacterPosition := LastCharacterPosition - 1; MaxLengthString := DELSTR(MaxLengthString,LastCharacterPosition); END;
Then for the SourceExpr of your textboxes you can use: GetMaxLengthString(Name,20 ? ,’ ‘) GetMaxLengthString(Address,20 ? ,’ ') You have to find the maximum number of characters you can fit, try with strings like WWWWW which take up more space. I know this doesn’t use the width of the characters and maybe that’s not exactly what you wanted, but… oh well
Thanx, although it ain’t precise enough (I mean pixels)but it’ll do, thanx for that source-field-function trick … I hope that Microsoft will expand Navision developing enviroment with more detailed one, similar to dot net, … , although I like the Spartan look of the Navision’s interface… A. P.S. For the mass-billing I’m using line matrix printer, and the smallest readable font size, and it still doesn’t fit the borders, so I needed to manage somehow with this string breaking solutions.
The topic isn’t dead and I’m not the only one here… Maybe someone will present you a better solution [8D] Don’t worry too much for the spartan programming of Navision, it does the job just fine. We should be thankful that we have a development environment at all! [:D] Glad to help, best of luck and regards