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

Formatting issues within a Formula?

Status
Not open for further replies.

egundrum

Technical User
Dec 29, 2004
13
US
CR 10, Sybase database

lbass helped me with this following formula in a previous thread and it works great. I'm trying to work on a couple formatting issues and hope someone can provide some insight.

Here is the code for the formula:

whileprintingrecords;
stringvar array parm := {?parm};
numbervar counter;
stringvar display;
stringvar array parmoptions := ["All Financial Statements","Management Letter","Corrective Action Plan","Federal Awards","Other Description"];
redim preserve parmoptions[ubound(parmoptions)];
redim preserve parm[ubound(parmoptions)];

for counter := 1 to ubound(parmoptions) do(
if parmoptions[counter] in parm then
display := display + "__X__" + parmoptions[counter] + chr(13)
else
display := display + "_____" + parmoptions[counter] + chr(13));
display;

Here are the results I get based upon the user passing the 3 parameters that have "X" below:

__X__ All financial statements related to the report.
_____ Copy of the management letter mentioned in the statements.
__X__ Current status of Corrective Action Plan.
_____ Schedule of Federal Awards (Identify HRI Grants)
__X__ Other


Here are my formatting issues:

1) I would like to have the "X" fully underlined. I can possibly do it by creating 5 new formulas (one for each possible parameter) that results in a text field " X " formatting with an underline border and placing it to the left of the formula above, but the position of the big formula results can vary (the report is a letter).
2) I would also like to have all the text descriptions aligned left justified. The line items above that have "X" are indented about 1/2 character to the right in relation to the unchecked items.

Any thought on these issues? THANKS! -Ed
 
Break the formula field out into 2 formulas, that way you can format each differently (left justified or whatever).

As for the underline of the X, conside using a line (insert->line) rather than an underlined font as most fonts are proportional, whereas a line will be constant.

-k

 
Thanks synapse!!! Worked like a charm! I was a bit concerned that the lines would shift on me, but they seem to adjust to the relative positions of the text items.

Thanks again!
 
egundrum, I spent time trying to figure this out, but was unable to get a result where ONLY the X was underlined. SV's idea about changing the formula into two formulas was key. You can build the spacing into the formulas by using:

//{@X}:
whileprintingrecords;
stringvar array parm := {?parm};
numbervar counter;
stringvar display;
stringvar array parmoptions := ["All Financial Statements","Management Letter","Corrective Action Plan","Federal Awards","Other Description"];
redim preserve parmoptions[ubound(parmoptions)];
redim preserve parm[ubound(parmoptions)];

for counter := 1 to ubound(parmoptions) do(
if parmoptions[counter] in parm then
display := display + " X " + chr(9) + chr(13) else
display := display + chr(9) + chr(13));
display

//{@parmoptions}:
whileprintingrecords;
stringvar array parm := {?parm};
numbervar counter;
stringvar array parmoptions := ["All Financial Statements","Management Letter","Corrective Action Plan","Federal Awards","Other Description"];
redim preserve parmoptions[ubound(parmoptions)];
redim preserve parm[ubound(parmoptions)];
stringvar displayx;

for counter := 1 to ubound(parmoptions) do(
displayx := displayx + parmoptions[counter] + chr(13));
displayx;

Place these next to each other, and then select {@X} and click on the Underline icon U to underline the X's and to show a line to the left of non-selected options.

-LB

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top