Focal Point
[SOLVED] Changing the Order of tabs when using BYTOC

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

June 17, 2011, 04:17 PM
pvparuc
[SOLVED] Changing the Order of tabs when using BYTOC
Hi,

I am trying to create a report in EXL2K to display the values from different countries in different Tabs..

TABLE FILE CAR
PRINT
CAR
SALES
BY COUNTRY NOPRINT
BY SEATS NOPRINT
ON TABLE PCHOLD FORMAT EXL2K BYTOC
END

but I am trying to reorder these tabs according to the SEATS

Is there any way I can do that.

Thanks in Advance,
pvparuc

This message has been edited. Last edited by: Kerry,


Release: Webfocus 7.6.11
OS/Platform: Windows
Output: HTML, EXL2K
June 17, 2011, 06:33 PM
Dan Satchell
I used SALES instead of SEATS because a COUNTRY can have more than one number of SEATS and Excel will not allow duplicate tab names. I also sorted SALES highest to lowest so the COUNTRY with the highest SALES appears first in the spreadsheet. By appending blanks to the front of the COUNTRY name based on the size of total SALES, I was able to trick WebFOCUS into sorting the countries by SALES for the BYTOC. The blanks in front of the COUNTRY names are compressed and disappear when displayed as spreadsheet tab names.

SET ASNAMES = ON
SET HOLDLIST = PRINTONLY
-*
TABLE FILE CAR
 SUM
  SALES AS 'COUNTRY_SALES'
 BY COUNTRY
 PRINT
  CAR
  SALES
 BY COUNTRY
 ON TABLE HOLD AS HOLD1
END
-*
TABLE FILE HOLD1
 PRINT
  CAR
  SALES
  COMPUTE BLANKS/A10V  = IF (COUNTRY_SALES EQ LAST COUNTRY_SALES) THEN LAST BLANKS ELSE (' ' | LAST BLANKS);
  COMPUTE SORT_KEY/A15 = BLANKS | COUNTRY ;
 BY HIGHEST COUNTRY_SALES
 ON TABLE HOLD AS HOLD2
END
-*
TABLE FILE HOLD2
 PRINT
  CAR
  SALES/I9C
 BY HIGHEST SORT_KEY NOPRINT
 ON SORT_KEY SUBTOTAL
 ON TABLE NOTOTAL
 ON TABLE PCHOLD FORMAT EXL2K BYTOC
END



WebFOCUS 7.7.05
June 20, 2011, 09:45 AM
pvparuc
Hi Dan,

Thanks for the reply, Didnt have a chance to look at it over the weekend...
I will try it and let you know if it works for me...

[Update]
Thanks Dan, It worked fine.

This message has been edited. Last edited by: pvparuc,


Release: Webfocus 7.6.11
OS/Platform: Windows
Output: HTML, EXL2K