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

How can I format the results??

Status
Not open for further replies.

puntito

Programmer
Mar 22, 2006
18
I'm starting a WebFocus Course. I am using the Northwind database contained in SQLserver.
In my notes I read that you can format the title of the columns:
Code:
...
PRINT                 |       ADDRESS        |TITLE      |
  TITLE/L             |  St Louis Ave. 456   |     SFDFT |
  ADDRESS/C           |  RiverFlow St. 411   |     RTHHE |
...
How can I format the result of the report? I have the column UnitsInStock, so, the Title is too long and the data are only 3 digits long. Is there a way to align the numbers at the center of the column.

Units In Stock
523
456
25
...

 
My first question is "What output format do you want?".

Column widths are the LARGER of either:

the column title

the format width

So, in your example, since the column title is wider that the field, it determines the column width.

In character oriented (non-GUI) output, numerics are right justified within the column width. If that's the output you want, you'll need to convert the fields to alpha (using either EDIT or the FTOA subroutine), and, once they're alpha, the subroutine CTRFLD can center them under the column heading.

Since you're using WebFOCUS, you probably DON'T want character format, but either HTML or PDF. In that case, you can use stylesheet commands to center the data. Here's an example:

Code:
TABLE FILE CAR
PRINT SEATS AS 'CAR SEATS'
ON TABLE SET STYLE *
TYPE=DATA, COLUMN=P1, JUSTIFY=CENTER,$
ENDSTYLE
END

P1 is the first printed column.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top