Focal Point
[Solved] Formatting of fields in Focus/WebFocus.

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/6627080795

January 17, 2011, 01:09 AM
Vinay Kumar
[Solved] Formatting of fields in Focus/WebFocus.
Hi All,



I would like to know, how Column3 can be displayed above Column4 and Column5.

To be precise, Column4 and Column5 comes under Column3 category, so it has to be displayed as shown in above pic.

Column4 and Column5 are aliases for the fields.

Could you all share your suggestions on how to do this.

This message has been edited. Last edited by: Vinay Kumar,


WebFOCUS 7.6.4, Mainframe Focus
Windows XP, All Output Formats
January 17, 2011, 05:10 AM
OPALTOSH
If we could see the image it would be helpful.
January 17, 2011, 05:21 AM
Vinay Kumar
Opaltosh,

Is image not visible?

Please find the image link below
http://i56.tinypic.com/2rnitd0.jpg


WebFOCUS 7.6.4, Mainframe Focus
Windows XP, All Output Formats
January 17, 2011, 07:05 AM
Ramkumar - Webfous
Hi Vinay,

As shown in the Image If this is for EXCEL Format 0f the report, Please find the code below.

TABLE FILE CAR
PRINT
COUNTRY AS 'COUNTRY'
CAR AS 'CAR'
SEATS
RETAIL_COST
HEADING
"<+0>COUNTRY/CAR<+0>"
ON TABLE PCHOLD FORMAT EXL2K
ON TABLE SET STYLE *
  UNITS=IN, SQUEEZE=ON, ORIENTATION=LANDSCAPE, $
  TYPE=REPORT, HEADALIGN=BODY, GRID=OFF, $
  TYPE=HEADING, LINE=1,  OBJECT=TEXT,     ITEM=1,     JUSTIFY=CENTER,   SIZE=10,  COLSPAN=2,STYLE=BOLD,$
END


This will work for HTML also.

But for PDF, you may need to do seperate stylig based on WIDTH of the heading elements.


Thanks,

Ramkumar.
WebFOCUS/Tableau
Webfocus 8 / 7.7.02
Unix, Windows
HTML/PDF/EXCEL/AHTML/XML/HTML5
January 17, 2011, 08:26 AM
Vinay Kumar
Hi Ram,

The above code worked for one category, what if there are multiple categories like the below image.

I mean how column3 and column5 could be displayed?



If the image is not visible, please find the image link below

http://i56.tinypic.com/333eudt.jpg


WebFOCUS 7.6.4, Mainframe Focus
Windows XP, All Output Formats
January 17, 2011, 08:46 AM
Vinay Kumar
Ram, Is there any other solution other than using TEXT's in HEADING.


WebFOCUS 7.6.4, Mainframe Focus
Windows XP, All Output Formats
January 17, 2011, 09:34 AM
Ramkumar - Webfous
 
TABLE FILE CAR
PRINT
 	 BODYTYPE
     SEATS
     DEALER_COST
     RETAIL_COST
     SALES
     MODEL
	 STANDARD
     CAR AS 'CAR'
     COUNTRY AS 'COUNTRY'
     LENGTH
     WIDTH
     HEIGHT
     WEIGHT
     WHEELBASE
     FUEL_CAP
     BHP
     RPM
     MPG
     ACCEL
     WARRANTY
HEADING
"<+0>BODYCOL<+0>SEATCOL<+0>DELCOSTCOL<+0>RETCOSTCOL<+0>SALES/MODEL<+0>STDCOL<+0>COUNTRY/CAR<+0>LENGTH/WIDTH<+0><+0>HEIGHT/WEIGHT<+0>"
ON TABLE PCHOLD FORMAT EXL2K
ON TABLE SET STYLE *
  UNITS=IN, SQUEEZE=ON, ORIENTATION=LANDSCAPE, $
  TYPE=REPORT, HEADALIGN=BODY, GRID=OFF, $
  TYPE=HEADING, LINE=1,  OBJECT=TEXT,     ITEM=1,     JUSTIFY=LEFT,   SIZE=10,  COLSPAN=1,STYLE=BOLD,$
  TYPE=HEADING, LINE=1,  OBJECT=TEXT,     ITEM=2,     JUSTIFY=RIGHT,   SIZE=10,  COLSPAN=1,STYLE=BOLD,$
  TYPE=HEADING, LINE=1,  OBJECT=TEXT,     ITEM=3,     JUSTIFY=RIGHT,   SIZE=10,  COLSPAN=1,STYLE=BOLD,$
  TYPE=HEADING, LINE=1,  OBJECT=TEXT,     ITEM=4,     JUSTIFY=RIGHT,   SIZE=10,  COLSPAN=1,STYLE=BOLD,$
  TYPE=HEADING, LINE=1,  OBJECT=TEXT,     ITEM=5,     JUSTIFY=CENTER,   SIZE=10,  COLSPAN=2,STYLE=BOLD,$
  TYPE=HEADING, LINE=1,  OBJECT=TEXT,     ITEM=6,     JUSTIFY=LEFT,   SIZE=10,  COLSPAN=1,STYLE=BOLD,$
  TYPE=HEADING, LINE=1,  OBJECT=TEXT,     ITEM=7,     JUSTIFY=CENTER,   SIZE=10,  COLSPAN=2,STYLE=BOLD,$
  TYPE=HEADING, LINE=1,  OBJECT=TEXT,     ITEM=8,     JUSTIFY=CENTER,   SIZE=10,  COLSPAN=2,STYLE=BOLD,$
  TYPE=HEADING, LINE=1,  OBJECT=TEXT,     ITEM=9,     JUSTIFY=CENTER,   SIZE=10,  COLSPAN=2,STYLE=BOLD,$
END
 


This way you can add and Style any number of Heading Elements, and achieve Super Title/Sub Title format.

But If you are not going for Heading, It is very tough to achieve this.

You may go through This Thread for further more details.

You see if some of the suggestions given there helps you...


Thanks,

Ramkumar.
WebFOCUS/Tableau
Webfocus 8 / 7.7.02
Unix, Windows
HTML/PDF/EXCEL/AHTML/XML/HTML5
January 17, 2011, 08:00 PM
Vinay Kumar
Thanks Ram Smiler

Your posted thread was very helpful!


WebFOCUS 7.6.4, Mainframe Focus
Windows XP, All Output Formats
January 17, 2011, 10:43 PM
Vinay Kumar
Ram,

Your code hasn't worked for me. See the output i got below.



If image is not visible to you, please find image link below.

http://i51.tinypic.com/14l6f7b.jpg


WebFOCUS 7.6.4, Mainframe Focus
Windows XP, All Output Formats
January 18, 2011, 01:04 AM
Ramkumar - Webfous
quote:
TABLE FILE CAR
PRINT
BODYTYPE
SEATS
DEALER_COST
RETAIL_COST
SALES
MODEL
STANDARD
CAR AS 'CAR'
COUNTRY AS 'COUNTRY'
LENGTH
WIDTH
HEIGHT
WEIGHT
WHEELBASE
FUEL_CAP
BHP
RPM
MPG
ACCEL
WARRANTY
HEADING
"<+0>BODYCOL<+0>SEATCOL<+0>DELCOSTCOL<+0>RETCOSTCOL<+0>SALES/MODEL<+0>STDCOL<+0>COUNTRY/CAR<+0>LENGTH/WIDTH<+0><+0>HEIGHT/WEIGHT<+0>"
ON TABLE PCHOLD FORMAT EXL2K
ON TABLE SET STYLE *
UNITS=IN, SQUEEZE=ON, ORIENTATION=LANDSCAPE, $
TYPE=REPORT, HEADALIGN=BODY, GRID=OFF, $
TYPE=HEADING, LINE=1, OBJECT=TEXT, ITEM=1, JUSTIFY=LEFT, SIZE=10, COLSPAN=1,STYLE=BOLD,$
TYPE=HEADING, LINE=1, OBJECT=TEXT, ITEM=2, JUSTIFY=RIGHT, SIZE=10, COLSPAN=1,STYLE=BOLD,$
TYPE=HEADING, LINE=1, OBJECT=TEXT, ITEM=3, JUSTIFY=RIGHT, SIZE=10, COLSPAN=1,STYLE=BOLD,$
TYPE=HEADING, LINE=1, OBJECT=TEXT, ITEM=4, JUSTIFY=RIGHT, SIZE=10, COLSPAN=1,STYLE=BOLD,$
TYPE=HEADING, LINE=1, OBJECT=TEXT, ITEM=5, JUSTIFY=CENTER, SIZE=10, COLSPAN=2,STYLE=BOLD,$
TYPE=HEADING, LINE=1, OBJECT=TEXT, ITEM=6, JUSTIFY=LEFT, SIZE=10, COLSPAN=1,STYLE=BOLD,$
TYPE=HEADING, LINE=1, OBJECT=TEXT, ITEM=7, JUSTIFY=CENTER, SIZE=10, COLSPAN=2,STYLE=BOLD,$
TYPE=HEADING, LINE=1, OBJECT=TEXT, ITEM=8, JUSTIFY=CENTER, SIZE=10, COLSPAN=2,STYLE=BOLD,$
TYPE=HEADING, LINE=1, OBJECT=TEXT, ITEM=9, JUSTIFY=CENTER, SIZE=10, COLSPAN=2,STYLE=BOLD,$
END



This code fetches me the right expected output...

Vinay, Did you copied the entire code... ??

My Output is




Thanks,

Ramkumar.
WebFOCUS/Tableau
Webfocus 8 / 7.7.02
Unix, Windows
HTML/PDF/EXCEL/AHTML/XML/HTML5
January 18, 2011, 01:05 AM
Ramkumar - Webfous
quote:
Thanks Ram

Your posted thread was very helpful!


You are welcome Vinay. Smiler


Thanks,

Ramkumar.
WebFOCUS/Tableau
Webfocus 8 / 7.7.02
Unix, Windows
HTML/PDF/EXCEL/AHTML/XML/HTML5
January 18, 2011, 03:09 AM
Vinay Kumar
Ram, now i got it. Thanks!

I might have missed something previously.


WebFOCUS 7.6.4, Mainframe Focus
Windows XP, All Output Formats
January 18, 2011, 05:12 AM
Ramkumar - Webfous
Thatz Fine Vinay !!!


Thanks,

Ramkumar.
WebFOCUS/Tableau
Webfocus 8 / 7.7.02
Unix, Windows
HTML/PDF/EXCEL/AHTML/XML/HTML5
January 18, 2011, 05:39 AM
Vinay Kumar
Ram, This solution works fine for HTML, Excel!

How about for PDF? Have you ever tried?


WebFOCUS 7.6.4, Mainframe Focus
Windows XP, All Output Formats
February 01, 2011, 08:57 AM
Ramkumar - Webfous
Hi Vinay,

For PDF you may need to do trial in Error in Width and acheive values...

Instead of COLSPAN=1, You need to assign width=3.50 , 4.50 etc. until you reach you exact template.


Thanks,

Ramkumar.
WebFOCUS/Tableau
Webfocus 8 / 7.7.02
Unix, Windows
HTML/PDF/EXCEL/AHTML/XML/HTML5
February 01, 2011, 08:58 AM
Ramkumar - Webfous
Forgot... Also Remove this part as well...

 TYPE=REPORT, HEADALIGN=BODY, GRID=OFF, $
 



Thanks,

Ramkumar.
WebFOCUS/Tableau
Webfocus 8 / 7.7.02
Unix, Windows
HTML/PDF/EXCEL/AHTML/XML/HTML5