I got problem in printing multiple lines with the following conditions.
1. Print multiple lines of item descriptions, only allow to print 25 characters per line.
2. If item description less than 25 characters, the system must not print additional blank line (that's what happen when you use MultiLine = Yes and adjust the height of the textbox). The following have been incorporate into the report but the result does not meet our requirement.
v_DescLen := STRLEN(Description);
IF ((v_DescLen > 0) OR (pint_StartDesc = 1)) THEN BEGIN
CurrReport.SHOWOUTPUT := TRUE;
IF (v_DescLen > 25) THEN
gtxt_Description := COPYSTR(Description,pint_StartDesc,25)
ELSE IF (gint_DescLen > 0) THEN
gtxt_Description := COPYSTR(Description,pint_StartDesc,gint_DescLen);
3. If item description print more than a line (25 characters per line), the system must print the "whole" word instead of "cut" the word into two portion and print it on two separate lines. For an example, the last word for the first line is "sample" and 25th character end at "m", the system should print "sample" on the second line instead of printing "sam" for the first line and "ple" for the second line.
Appreciate any advice to the above issue.
Comments
The following will wrap the text based on a space ' ' or '-' or ','
You can add more 'breakpoints' if you wish.
It will not print any more characters than maximum specified, then work backwards to find the first 'breakpoint' character as specified.
This is how you can achieve it.
Create a var DescriptionText2
Add another body section for Line which only prints the variable DescriptionText2
add code to the section: Call the following from Line.OnAfterGetRecord create the new function that you call as below (first line shows you that the function accepts 2 variables and returns a text):
Hope this helps,
gus
Then print the normal section if the description is < 25 and print the multiline section if descripion > 25.
This way the wrap of the description will be done quite nice, not dumb after 25 charaters.
If it was hard to write, it should be hard to understand."
Thanks for all your help! I got the result that I need... Thank you, thank you, thank you......