IB - Developer Center    Forums  Hop To Forum Categories  FOCUS/WebFOCUS    Proper alignment SUBFOOT for PDF and EXCEL
Go
New
Search
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Silver Member
Posted
I have a FOCEXEC that for various reasons needs to use SUBFOOT and positional formatting to align the subtotals and grand totals. I have the alignment working perfectly for PDFs. However, I pass a parameter to the FOCEXEC to determine if it should generate a PDF or an EXCEL 2000 file. Everything works great and looks great EXCEPT for the SUBFOOT lines. I've done a few tweaks to alignment and all it does is screw up my PDF alignment. How can I align my excel subfoots differently than my PDF subfoot? or what's the best mechanism that will align correctly for both?


SET ALL=ON, NODATA=''
-DEFAULT &rptfmt = 'PDF';
-SET &ECHO=ALL;

SQL SQLMSS SET SERVER SERVERNAME
SQL SQLMSS                                                                      
EX DB.dbo.SP '&ddlDirector', '&ddlManager', '&ddlYear';

TABLE FILE SQLOUT
PRINT *          
ON TABLE HOLD AS REPDATA
END

DEFINE FILE REPDATA
DIRNAME/A15 = DirectorLogin;
MGRNAME/A15 = ManagerLogin;
PPACT/D12M = PActDollars;
PPYTD/D12M = PYTDDollars;
PYTDCHANGE/D7.1% = PYTDChangeDollars;
PCPLAN/D12M = CPlanDollars;
PCYTD/D12M = CYTDDollars;
CPVSACT/D7.1% = CPVSDollars;
END


TABLE FILE REPDATA
PRINT 
	DirectorLogin AS 'DIRECTOR'
	ManagerLogin AS 'MANAGER'
	Category/A8 AS 'CATEGORY'
	Other_Name/A8 AS 'OTHER'
	Mrg AS 'MGR'
	Country/A8 AS 'COUNTRY'
	PPACT AS 'Total,Actual'
	PPYTD AS 'YTD'
	PYTDCHANGE AS 'TY/LY,YTD +/-'
	PCPLAN AS 'Plan,DOLLARS'
	PCYTD AS 'ACT,YTD'
	CPVSACT AS '2006,Plan vs,Act +/-'
COMPUTE PREVPERCENT/D7.1% = (PPACT / TOT.PPACT) * 100; AS '2006 %,to Total'
COMPUTE CURRPERCENT/D7.1% = (PCPLAN / TOT.PCPLAN) * 100; AS '2007 %,to Total'

COMPUTE PACTYEAR/D7.1% = (PPACT / TOT.PPACT) * 100; NOPRINT
COMPUTE PYTDYEAR/D7.1% = (PPYTD/TOT.PPYTD) * 100; NOPRINT
COMPUTE CPLANYEAR/D7.1% = (PCPLAN / TOT.PCPLAN) * 100; NOPRINT
COMPUTE CYTDYEAR/D7.1% = (PCYTD/TOT.PCYTD) * 100; NOPRINT
	

HEADING CENTER
"Report Date: &DATEMDYY"
" "

BY Mrg NOPRINT

ON Mrg SUBFOOT
" <+0> Total <+0> <MRG <+0> <ST.PPACT <+0> <ST.PPYTD <+0> <ST.PCPLAN <+0> <ST.PCYTD "
"Percent to total year <+0> <ST.PACTYEAR <+0> <ST.PYTDYEAR <+0> <ST.CPLANYEAR <+0> <ST.CYTDYEAR "

ON TABLE SET PAGE-NUM OFF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLEMODE FIXED
ON TABLE SUBFOOT
" <+0> Grand Total <+0> <TOT.PPACT <+0> <TOT.PPYTD <+0> <TOT.PCPLAN <+0> <TOT.PCYTD "
ON TABLE PCHOLD FORMAT &rptfmt
ON TABLE SET STYLE *
	UNITS=IN,
	PAGESIZE='LETTER',
	SQUEEZE=ON,
	LEFTMARGIN=0.20,
	RIGHTMARGIN=0.20,
	TOPMARGIN=0.10,
	BOTTOMMARGIN=0.10,
	ORIENTATION=LANDSCAPE,
$
TYPE=REPORT,
	GRID=ON,
	FONT='ARIAL',
	SIZE=7,
	COLOR='BLACK',
	BACKCOLOR='NONE',
	STYLE=NORMAL,
	LINEBREAK='CRLF',
$
TYPE=TITLE,STYLE=BOLD,JUSTIFY=CENTER,$
TYPE=HEADING, STYLE=BOLD, JUSTIFY=CENTER, BACKCOLOR=RGB(170 213 255),$
TYPE=SUBFOOT,HEADALIGN=BODY,STYLE=BOLD,BACKCOLOR=ORANGE,$
TYPE=TABFOOTING,HEADALIGN=BODY,STYLE=BOLD,BACKCOLOR=LIGHT BLUE,$

TYPE=REPORT,COLUMN=P1,WIDTH=15,JUSTIFY=LEFT,$ 
TYPE=REPORT,COLUMN=P2,WIDTH=15,JUSTIFY=LEFT,$
TYPE=REPORT,COLUMN=P3,WIDTH=9,JUSTIFY=LEFT,$
TYPE=REPORT,COLUMN=P4,WIDTH=9,JUSTIFY=LEFT,$
TYPE=REPORT,COLUMN=P5,WIDTH=4,JUSTIFY=CENTER,$
TYPE=REPORT,COLUMN=P6,WIDTH=9,JUSTIFY=LEFT,$
TYPE=REPORT,COLUMN=P7,WIDTH=10,JUSTIFY=RIGHT,$
TYPE=REPORT,COLUMN=P8,WIDTH=10,JUSTIFY=RIGHT,$
TYPE=REPORT,COLUMN=P9,WIDTH=6,JUSTIFY=RIGHT,$
TYPE=REPORT,COLUMN=P10,WIDTH=10,JUSTIFY=RIGHT,$
TYPE=REPORT,COLUMN=P11,WIDTH=10,BACKCOLOR=YELLOW,JUSTIFY=RIGHT,$
TYPE=REPORT,COLUMN=P12,WIDTH=6,JUSTIFY=RIGHT,$
TYPE=REPORT,COLUMN=P13,WIDTH=6,JUSTIFY=RIGHT,$
TYPE=REPORT,COLUMN=P14,WIDTH=5,JUSTIFY=RIGHT,$
TYPE=TITLE,COLUMN=C*,JUSTIFY=CENTER,$

TYPE=SUBFOOT,STYLE=BOLD,LINE=1,ITEM=1,OBJECT=TEXT,JUSTIFY=LEFT,POSITION=Category,$
TYPE=SUBFOOT,STYLE=BOLD,LINE=1,ITEM=1,OBJECT=FIELD,JUSTIFY=LEFT,POSITION=Supplier_Name,$
TYPE=SUBFOOT,STYLE=BOLD,LINE=1,ITEM=2,OBJECT=FIELD,JUSTIFY=RIGHT,POSITION=PPACT,$
TYPE=SUBFOOT,STYLE=BOLD,LINE=1,ITEM=3,OBJECT=FIELD,JUSTIFY=RIGHT,POSITION=PPYTD,$
TYPE=SUBFOOT,STYLE=BOLD,LINE=1,ITEM=4,OBJECT=FIELD,JUSTIFY=RIGHT,POSITION=PCPLAN,$
TYPE=SUBFOOT,STYLE=BOLD,LINE=1,ITEM=5,OBJECT=FIELD,JUSTIFY=RIGHT,POSITION=PCYTD,$
TYPE=SUBFOOT,STYLE=BOLD,LINE=2,ITEM=1,OBJECT=FIELD,JUSTIFY=RIGHT,POSITION=PPACT,$
TYPE=SUBFOOT,STYLE=BOLD,LINE=2,ITEM=2,OBJECT=FIELD,JUSTIFY=RIGHT,POSITION=PPYTD,$
TYPE=SUBFOOT,STYLE=BOLD,LINE=2,ITEM=3,OBJECT=FIELD,JUSTIFY=RIGHT,POSITION=PCPLAN,$
TYPE=SUBFOOT,STYLE=BOLD,LINE=2,ITEM=4,OBJECT=FIELD,JUSTIFY=RIGHT,POSITION=PCYTD,$

TYPE=TABFOOTING,STYLE=BOLD,LINE=1,ITEM=1,OBJECT=FIELD,JUSTIFY=RIGHT,POSITION=PPACT,$
TYPE=TABFOOTING,STYLE=BOLD,LINE=1,ITEM=2,OBJECT=FIELD,JUSTIFY=RIGHT,POSITION=PPYTD,$
TYPE=TABFOOTING,STYLE=BOLD,LINE=1,ITEM=3,OBJECT=FIELD,JUSTIFY=RIGHT,POSITION=PCPLAN,$
TYPE=TABFOOTING,STYLE=BOLD,LINE=1,ITEM=4,OBJECT=FIELD,JUSTIFY=RIGHT,POSITION=PCYTD,$



ENDSTYLE

END

SET EMPTYREPORT=ON
-RUN
-IF &RECORDS EQ 0 GOTO NORPT;
-EXIT
-NORPT
-HTMLFORM NOREC2




WebFOCUS 7.1.5 on Win2K using SQL2000/SQL2005/ORACLE10.4
 
Posts: 47 | Registered: March 02, 2007Reply With QuoteEdit or Delete MessageReport This Post
Virtuoso
Posted Hide Post
Check out Mickey's write up on PDF output for some insight.
http://www.informationbuilders.com/support/developers/index.html

You are going to have to add some GOTO statments for different Styling for each type of Output.


WebFOCUS 7.6.1 Win 2003 Test -7.6.5
 
Posts: 1188 | Location: San Antonio | Registered: February 28, 2005Reply With QuoteEdit or Delete MessageReport This Post
Expert
Posted Hide Post
Here's a simple example that works for both PDF and Excel. I've added the colours to show which elements are affected by which style-sheet code. The COLSPAN is ignored for PDF, but helps position the second element in the SUBFOOT for Excel 2000.

TABLE FILE CAR
SUM
SALES RETAIL DEALER
BY COUNTRY
BY CAR

ON COUNTRY SUBFOOT
"SUBTOTAL<+0><ST.SALES<+0><ST.RETAIL<+0><ST.DEALER"
HEADING
"WEBFOCUS REPORT"
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLESHEET *
FONT='ARIAL', SIZE=8, GRID=OFF, $
TYPE=SUBFOOT, HEADALIGN=BODY, STYLE=BOLD, JUSTIFY=RIGHT,$
TYPE=SUBFOOT,ITEM=1, COLSPAN=2, POSITION=COUNTRY, JUSTIFY=LEFT, COLOR=ORANGE, $
TYPE=SUBFOOT,ITEM=2,POSITION=SALES, COLOR=RED,$
TYPE=SUBFOOT,ITEM=3,POSITION=RETAIL, COLOR=GREEN,$
TYPE=SUBFOOT,ITEM=4,POSITION=DEALER, COLOR=BLUE,$
END

I hope this helps.


This message has been edited. Last edited by: Francis Mariani,


Francis



Env 1: WebFOCUS 5.3.2 Servlet - MRE/BID/Self Service/ReportCaster - MS Windows Server 2003 - IIS/New Atlanta ServletExec - MS SQL Server 2000 - DataMigrator 5.3.4
Env 2: WebFOCUS 7.6.5 Servlet - MRE/BID/Self Service - MS Windows XP SP2 - Apache Tomcat/5.5.25 - MS SQL Server 2000
Env 3: WebFOCUS 5.3.3 CGI - Self Service - AIX 5.2 - IBM DB2
Output formats: HTML, Excel 2000 and PDF
 
Posts: 3379 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Reply With QuoteEdit or Delete MessageReport This Post
Virtuoso
Posted Hide Post
Oh now that's nice.


WebFOCUS 7.6.1 Win 2003 Test -7.6.5
 
Posts: 1188 | Location: San Antonio | Registered: February 28, 2005Reply With QuoteEdit or Delete MessageReport This Post
 Previous Topic | Next Topic powered by eve community  
 

IB - Developer Center    Forums  Hop To Forum Categories  FOCUS/WebFOCUS    Proper alignment SUBFOOT for PDF and EXCEL

Copyright © 1996-2008 Information Builders, leaders in enterprise business intelligence.