Upload
griselda-lynch
View
233
Download
4
Embed Size (px)
Citation preview
Copyright 2007, Information Builders. Slide 1
The Most Requested Features and Techniques for Stylesheets
Renee TeatroInformation Builders
Copyright 2007, Information Builders. Slide 2
The Stylesheet Facility – Features and TechniquesLINEBREAK Attribute: TYPE=REPORT,LINEBREAK='type',$
WebFOCUS Release 7.1.3 Respect CARRIAGE RETURNs (CR) and LINE FEEDs (LF) ALPHANUMERIC fields – both An and AnV formats
REPORT is the type of report component. TYPE must be REPORT; otherwise an error will result. 'type‘ specifies that line breaks will be inserted in a report based on the following:
LF Inserts a line break after each line-feed character found in all An and AnV fields.
CR Inserts a line break after each carriage-return character found in all An and AnV fields.
LFCR Inserts a line break after each combination of a line-feed character followed by a
carriage-return character found in all An and AnV fields. CRLF
Inserts a line break after each combination of a carriage-return character followed by a line-feed character found in all An and AnV fields.
If An/AnV fields are included in HEADINGs (SUBHEADs, SUBFOOTs), WRAP=n attribute must be included in the Stylesheet syntax for these fields to make the LINEBREAK attribute effective.
Copyright 2007, Information Builders. Slide 3
The Stylesheet Facility – Features and TechniquesLINEBREAK Attribute: TYPE=REPORT,LINEBREAK='type',$
DEFINE FILE CAR CR/A1 = HEXBYT(13, 'A1'); LF/A1 = HEXBYT(10, 'A1'); CRLF/A2 = CR || LF; ABC1/A5 = EDIT (COUNTRY, '99999'); ABC2/A10 = EDIT (COUNTRY, '$$$$$9999999999'); ABC3/A30 = ABC1 || CRLF || ABC2; ABC4/A30V = ABC1 || CRLF || ABC2;ENDTABLE FILE CARPRINT ABC3 ABC4ON TABLE PCHOLD FORMAT PDFON TABLE SET STYLE *TYPE=REPORT,LINEBREAK='CRLF',$ENDSTYLEEND
Works for PDF and EXL2K
What about HTML?
Copyright 2007, Information Builders. Slide 4
The Stylesheet Facility – Features and TechniquesLINEBREAK Attribute: TYPE=REPORT,LINEBREAK='type',$
…<TABLE BORDER CELLPADDING=1><TR><TD COLSPAN=2><TABLE CELLPADDING=0 WIDTH="100%"><TR><TD>PAGE 1</TD></TR></TABLE></TD></TR><TR><TD VALIGN=BOTTOM>ABC3</TD><TD VALIGN=BOTTOM>ABC4</TD></TR><TR><TD>ENGLAND</TD><TD>ENGLAND</TD></TR><TR><TD>JAPAN</TD><TD>JAPAN</TD></TR><TR><TD>ITALY</TD><TD>ITALY</TD></TR><TR><TD>W GERMANY</TD>…
Copyright 2007, Information Builders. Slide 5
The Stylesheet Facility – Features and TechniquesLINEBREAK Attribute: TYPE=REPORT,LINEBREAK='type',$DEFINE FILE CAR CR/A1 = HEXBYT(13, 'A1'); LF/A1 = HEXBYT(10, 'A1'); CRLF/A2 = CR || LF; ABC1/A5 = EDIT (COUNTRY, '99999'); ABC2/A10 = EDIT (COUNTRY, '$$$$$9999999999'); ABC3/A30 = ABC1 || CRLF || ABC2; ABC3A/A32=STRREP(32,ABC3,2,CRLF,4,'<BR>',32,'A32'); ABC4/A30V = ABC1 || CRLF || ABC2; ABC4A/A32V=STRREP(32,ABC4,2,CRLF,4,'<BR>',32,'A32V'); ENDTABLE FILE CARPRINT ABC3A ABC4AON TABLE PCHOLD FORMAT HTMLEND
Use Global Replacement of CRLF with <BR>
or
Use <PRE> tag at beginning and </PRE> atend of field
Copyright 2007, Information Builders. Slide 6
The Stylesheet Facility – Features and Techniques Conditional Styling – WHEN Attribute
TABLE FILE CAR
PRINT COUNTRY CAR SEATS
ON TABLE SET STYLE *
DEFMACRO=COND1,STYLE=BOLD,COLOR=BLUE,
WHEN=SEATS LT 4,$
DEFMACRO=COND2,COLOR=RED,WHEN=SEATS EQ 5,$
TYPE=DATA,MACRO=COND1,COLUMN=SEATS,$
TYPE=DATA,MACRO=COND2,COLUMN=SEATS,STYLE=ITALIC,$
ENDSTYLE
END
Copyright 2007, Information Builders. Slide 7
The Stylesheet Facility – Features and TechniquesSequential Conditional Styling – WHEN Attribute
TABLE FILE CAR" SALES REVENUE "SUM COUNTRY CAR BY HIGHEST SALES ON TABLE SET STYLE *TYPE=DATA,BACKCOLOR=AQUA,STYLE=BOLD,WHEN=SALES GT 25000,$ TYPE=DATA,BACKCOLOR=GREEN,STYLE=BOLD,WHEN=SALES GT 10000,$ TYPE=DATA,BACKCOLOR=PINK,STYLE=BOLD,WHEN=SALES GT 1,$ TYPE=DATA,BACKCOLOR=RED,STYLE=BOLD,$END
Copyright 2007, Information Builders. Slide 8
The Stylesheet Facility – Features and Techniques Alternate Row Colors – BACKCOLOR Attribute
TABLE FILE CARPRINT CAR MODEL SEATSBY COUNTRYWHERE COUNTRY EQ 'ENGLAND' OR 'ITALY'ON TABLE SET STYLE *TYPE=DATA, BACKCOLOR=('AQUA' 'WHITE'),$ENDSTYLEEND
Copyright 2007, Information Builders. Slide 9
The Stylesheet Facility – Features and Techniques Alternate Row Colors – BACKCOLOR Attribute
TABLE FILE CARPRINT RCOST DCOST SEATSBY COUNTRYBY CARBY MODELON TABLE SET STYLE *TYPE=DATA, BACKCOLOR=(BY=COUNTRY 'AQUA' 'WHITE' 'RED'),$ENDSTYLEEND
Copyright 2007, Information Builders. Slide 10
The Stylesheet Facility – Features and Techniques SKIPLINE Attribute – PDF Format
TABLE FILE CARPRINT DEALER_COST RETAIL_COSTBY COUNTRY SKIP-LINEBY CARBY MODELON TABLE PCHOLD FORMAT PDFON TABLE SET STYLE *TYPE=SKIPLINE,BACKCOLOR=RED,$ENDSTYLEEND
Designed for styling only – Not to generate line
Works for PDF
What about EXL2K and HTML?
Copyright 2007, Information Builders. Slide 11
The Stylesheet Facility – Features and Techniques SKIPLINE Attribute – Generate effect for EXL2K / HTML
TABLE FILE CARPRINT DEALER_COST RETAIL_COSTBY COUNTRY SUBFOOT" "BY CARBY MODELON TABLE PCHOLD FORMAT EXL2KON TABLE SET STYLE *TYPE=SUBFOOT,BACKCOLOR=RED,$ENDSTYLEEND
Use ON sortfield SUBFOOT syntaxto generate line
Use TYPE=SUBFOOT for styling
Works for both EXL2K and HTML
Copyright 2007, Information Builders. Slide 12
The Stylesheet Facility – Features and Techniques TITLETEXT Attribute: TYPE=REPORT,TITLETEXT=txt,$
TABLE FILE CARSUM RCOST DCOSTBY COUNTRYBY CARBY MODELON TABLE PCHOLD FORMAT EXL2KON TABLE SET STYLE *TYPE=REPORT,FONT=COURIER NEW, TITLETEXT='Car Sales Report',$ENDSTYLEEND
What happens with HTML?
Excel limits the length of worksheet titles to 31 characters. The following special characters cannot be used:
':', '?', '*', and '/'.
Copyright 2007, Information Builders. Slide 13
The Stylesheet Facility – Features and Techniques TITLETEXT Attribute: TYPE=REPORT,TITLETEXT=txt,$
TABLE FILE CARSUM RCOST DCOSTBY COUNTRYBY CARBY MODELON TABLE PCHOLD FORMAT HTMLON TABLE SET STYLE *TYPE=REPORT,FONT=COURIER NEW, TITLETEXT='Car Sales Report',$ENDSTYLEEND
Using HTML allows the Browser Title to be customized
Feature not applicable to PDF
Copyright 2007, Information Builders. Slide 14
The Stylesheet Facility – Features and Techniques - (Dash) Option – Remove one attribute while retaining anotherTABLE FILE CARPRINT 'CAR.ORIGIN.COUNTRY' 'CAR.COMP.CAR' 'CAR.CARREC.MODEL' ON TABLE SET PAGE-NUM OFFON TABLE NOTOTALON TABLE PCHOLD FORMAT HTMLON TABLE SET HTMLCSS ONON TABLE SET STYLE *TYPE=REPORT, GRID=OFF,$TYPE=TITLE, STYLE=BOLD,$TYPE=TITLE, STYLE=-UNDERLINE, WHEN=1 EQ 1,$ENDSTYLEEND
Copyright 2007, Information Builders. Slide 15
The Stylesheet Facility – Features and Techniques Conditional Display of SUBHEADs and SUBFOOTsTABLE FILE CARSUM SALESBY COUNTRYON COUNTRY SUBHEAD"This is my Subhead Text"WHEN SALES GT 30000ON COUNTRY PAGE-BREAKON TABLE SET STYLE *TYPE=SUBHEAD,BACKCOLOR=YELLOW,STYLE=BOLD,$ENDSTYLEEND
Copyright 2007, Information Builders. Slide 16
The Stylesheet Facility – Features and Techniques Conditional Display of HEADINGs and FOOTINGsTABLE FILE CARSUM SALESBY COUNTRYON COUNTRY PAGE-BREAKFOOTING" Here is my Page Footing text -> Need More Sales"ON TABLE SET STYLE *TYPE=FOOTING,COLOR=WHITE, WHEN=SALES GT 30000,$ENDSTYLEEND
Copyright 2007, Information Builders. Slide 17
The Stylesheet Facility – Features and Techniques Conditional Style of COLUMN-TOTAL value TABLE FILE CARSUM RCOST DCOST BY COUNTRY BY CARON TABLE COLUMN-TOTALON TABLE ROW-TOTALON TABLE SET ONLINE-FMT HTMLON TABLE SET STYLE *TYPE=TITLE,COLUMN=ROWTOTAL,BACKCOLOR=YELLOW,$TYPE=DATA,COLUMN=ROWTOTAL,BACKCOLOR=WHITE,COLOR=BLUE,$TYPE=GRANDTOTAL,COLOR=GREEN,STYLE=ITALIC,$TYPE=GRANDTOTAL,COLUMN=DCOST,COLOR=PINK,STYLE=-ITALIC,FONT=COURIER,$TYPE=GRANDTOTAL,COLUMN=RCOST,COLOR=RED,STYLE=BOLD, WHEN=RCOST GT 150000,$ENDSTYLEEND
Copyright 2007, Information Builders. Slide 18
The Stylesheet Facility – Features and Techniques Styling ROW-TOTAL TITLE when using ACROSSTABLE FILE CARSUM DEALER_COST AS 'DC‘ RETAIL_COST AS 'RC'BY CARACROSS SEATSON TABLE SET PAGE-NUM OFF ON TABLE ROW-TOTAL AS 'RTOTAL'ON TABLE COLUMN-TOTAL AS 'CTOTAL'ON TABLE SET ONLINE-FMT HTMLON TABLE SET HTMLCSS ONON TABLE SET STYLE *TYPE=REPORT, GRID=OFF, FONT='ARIAL', SIZE=9, COLOR='BLACK', BACKCOLOR='NONE', STYLE=NORMAL, RIGHTGAP=0.125000, TOPGAP=0.013889, BOTTOMGAP=0.027778,$TYPE=TABHEADING, SIZE=12, STYLE=BOLD,$TYPE=HEADING, SIZE=12, STYLE=BOLD,$TYPE=SUBHEAD, SIZE=10, STYLE=BOLD,$TYPE=SUBTOTAL, BACKCOLOR=RGB(210 210 210),$TYPE=ACROSSVALUE, COLUMN=ROWTOTAL, COLOR='RED', BACKCOLOR=RGB(210 210 210), TOPGAP=0.013889, BOTTOMGAP=0.027778,$TYPE=GRANDTOTAL, BACKCOLOR=RGB(210 210 210), STYLE=BOLD,$ENDSTYLEEND
Copyright 2007, Information Builders. Slide 19
The Stylesheet Facility – Features and Techniques Vertical Line Between ColumnsTABLE FILE CARPRINT COUNTRY CAR MODELWHERE COUNTRY EQ 'JAPAN' OR 'FRANCE'ON TABLE SET STYLE *TYPE=DATA, COLUMN=N1, BORDER-LEFT=OFF,$TYPE=DATA, COLUMN=N2, BORDER-LEFT=ON,$TYPE=DATA, COLUMN=N3, BORDER-LEFT=ON,$ENDSTYLEON TABLE PCHOLD FORMAT PDFEND
Copyright 2007, Information Builders. Slide 20
The Stylesheet Facility – Features and Techniques IMAGE and TEXT on Same Line in HEADING for PDFTABLE FILE CAR HEADING "<+0> <+20> Car Report </2" SUM RCOST DCOST BY COUNTRY ON TABLE SET ONLINE-FMT PDF ON TABLE SET STYLE * TYPE=HEADING, IMAGE=C:\ibi\WebFOCUS71\ibi_html\ib_logo.gif, SIZE=(.8 .3),$ TYPE=HEADING,LINE=1,ITEM=2,OBJECT=TEXT, JUSTIFY=RIGHT,$ ENDSTYLE END
Copyright 2007, Information Builders. Slide 21
The Stylesheet Facility – Features and Techniques Vertical Text Technique – Using PDF
DEFINE FILE CARHCNTR/I2 WITH CAR=IF HCNTR LT 5 THEN HCNTR + 1 ELSE 1;VCNTR/I2 WITH CAR=IF HCNTR EQ 1 THEN VCNTR + 1 ELSE VCNTR;BLANK/A1 WITH CAR=' ';ENDTABLE FILE CARSUM BLANK AS ''COUNTRY AS ''MODEL AS ''CAR AS ''BY VCNTR NOPRINTACROSS HCNTR NOPRINTON TABLE NOTOTALON TABLE SET PAGE-NUM OFFON TABLE PCHOLD FORMAT PDFON TABLE SET STYLE *UNITS=IN,PAGESIZE='LETTER', LEFTMARGIN=0.250000,RIGHTMARGIN=0.250000,TOPMARGIN=0.250000,BOTTOMMARGIN=0.250000,SQUEEZE=ON,ORIENTATION=PORTRAIT,$TYPE=REPORT,FONT='TIMES NEW ROMAN',SIZE=10,COLOR='BLACK', BACKCOLOR=NONE, STYLE=NORMAL,$TYPE=DATA,ACROSSCOLUMN=N2, SIZE=9,$TYPE=TITLE,ACROSSCOLUMN=N2,SIZE=9,$TYPE=REPORT,ACROSSCOLUMN=N2, WRAP=0.015000,$TYPE=DATA,ACROSSCOLUMN=N3, SIZE=9,$TYPE=TITLE,ACROSSCOLUMN=N3,SIZE=9,$TYPE=REPORT,ACROSSCOLUMN=N3, WRAP=0.015000,$TYPE=DATA,ACROSSCOLUMN=N4, SIZE=9,$TYPE=TITLE,ACROSSCOLUMN=N4,SIZE=9,$TYPE=REPORT,ACROSSCOLUMN=N4, WRAP=0.015000,$TYPE=ACROSSVALUE,JUSTIFY=RIGHT,$ENDSTYLEEND
Copyright 2007, Information Builders. Slide 22
The Stylesheet Facility – Features and Techniques Vertical Text Technique – Using PDF – Simplified ExampleTABLE FILE CARSUM RCOST AS '' DCOST AS ''BY COUNTRY AS ''ON TABLE NOTOTALON TABLE SET PAGE-NUM OFFON TABLE PCHOLD FORMAT PDFON TABLE SET STYLE *UNITS=IN,PAGESIZE='LETTER', LEFTMARGIN=0.250000,RIGHTMARGIN=0.250000,TOPMARGIN=0.250000,BOTTOMMARGIN=0.250000,SQUEEZE=ON,ORIENTATION=PORTRAIT,$TYPE=REPORT,FONT='TIMES NEW ROMAN', SIZE=10,COLOR='BLACK', BACKCOLOR=NONE,STYLE=NORMAL,$TYPE=REPORT,COLUMN=COUNTRY,WRAP=0.015000, STYLE=BOLD,$ENDSTYLEEND What about HTML and EXL2K?
Copyright 2007, Information Builders. Slide 23
The Stylesheet Facility – Features and Techniques Vertical Text Technique – Using HTMLTABLE FILE CARPRINT CARBY COUNTRYBY MODELON TABLE SET STYLE *TYPE=REPORT,CSSURL=vtext.css,$TYPE=TITLE,CLASS=VTEXT,$TYPE=DATA,CLASS=DCOLOR,$ENDSTYLEEND vtext.css:
.DCOLOR {color:red; border:none} .VTEXT{writing-mode: tb-rl;filter: flipV flipH;font: bold 13px Arial;}
For EXL2K – Use EXCEL Template Feature
Orientation option in EXCEL
Copyright 2007, Information Builders. Slide 24
The Stylesheet Facility – Features and Techniques Cascading Stylesheets
A simple language to add styling to HTML documentsA W3C standard (World Wide Web consortium) Separates
Structural content of a document (HTML) from
styling instruction (CSS) CSS consists of one or more rules – Statements Statement
Selector – tells the browser which elements to style Declaration – tells the browser how to apply them
Copyright 2007, Information Builders. Slide 25
The Stylesheet Facility – Features and Techniques Cascading Stylesheets
Benefits Increased formatting options
Styling elements outside the scope of the WebFOCUS Stylesheet facility
Reduced transmission bandwidth Create concise HTML output, reducing overhead to the
browserReduced Coding
Ease of maintenance using a centralized CSS libraryAdherence to standards
Same look and feel for all Web documents
Copyright 2007, Information Builders. Slide 26
The Stylesheet Facility – Features and Techniques Cascading Stylesheets
Types of Cascading Style Sheets Internal
Styling instructions are stored internally in the <head.> of the HTML document
Browser interprets these instructionsExternal
Separate files accessible to the browser Inline
Stored within the tag of an HTML element, or within the <head> of the document
Combine both content and style Not recommended – but supported Used when certain elements should not be overridden
Copyright 2007, Information Builders. Slide 27
The Stylesheet Facility – Features and Techniques Cascading Stylesheets
Using CSS Internal
SET HTMLCSS = ON/OFF
ON TABLE SET HTMLCSS = ON/OFF
External
CSSURL=location/address
TYPE=REPORT,CSSURL=vtext.css,$
$ Located in MRE Other Files
TYPE=REPORT,
CSSURL=\\ssg\ServerPaths\apps\Renee\vtext.css,$
$ Located in Application Directory for Adhoc reporting
Copyright 2007, Information Builders. Slide 28
The Stylesheet Facility – Features and Techniques Labels Technique
PAGEMATRIX=(c r)Sets the number of columns and rows of labels on a page.
ELEMENT=(w h)
Sets the width and height of each label, expressed in the unit of measurement on the UNITS attribute.
GUTTER=(h v)Sets the horizontal and vertical distance between each label, expressed in the unit of measurement on the UNITS attribute.
MATRIXORDER={VERTICAL | HORIZONTAL}Sets the order in which the labels are printed.
LABELPROMPT={OFF | ON }Sets the position of the first label on the mailing label sheet.
Copyright 2007, Information Builders. Slide 29
The Stylesheet Facility – Features and Techniques Labels TechniqueTABLE FILE CARPRINT CAR AS ''BY CAR NOPRINTON TABLE SET PAGE-NUM NOPAGEON TABLE PCHOLD FORMAT PDFON TABLE SET STYLE *UNITS=IN, PAGESIZE=LETTER, LEFTMARGIN=0.25, TOPMARGIN=0.5,PAGEMATRIX=(2 5), ELEMENT=(1.50 .50) GUTTER=(0.188 9), $ENDSTYLEEND
Copyright 2007, Information Builders. Slide 30
The Stylesheet Facility – Features and Techniques Labels TechniqueTABLE FILE CARPRINT CAR AS ''BY CAR NOPRINTON TABLE SET PAGE-NUM NOPAGEON TABLE PCHOLD FORMAT PDFON TABLE SET STYLE *UNITS=IN, PAGESIZE=LETTER, LEFTMARGIN=0.25, TOPMARGIN=0.5,PAGEMATRIX=(3 4), ELEMENT=(1.50 .50) GUTTER=(0.188 9), $ENDSTYLEEND
Copyright 2007, Information Builders. Slide 31
The Stylesheet Facility – Features and Techniques Labels TechniqueSET ONLINE-FMT = PDFTABLE FILE EMPLOYEEBY LAST_NAME NOPRINT BY FIRST_NAME NOPRINTON FIRST_NAME PAGE-BREAKHEADING"<FIRST_NAME <LAST_NAME""<ADDRESS_LN1""<ADDRESS_LN2""<ADDRESS_LN3"ON TABLE SET PAGE-NUM NOPAGEON TABLE SET STYLE *UNITS=IN, PAGESIZE=LETTER, LEFTMARGIN=0.256, TOPMARGIN=0.5,PAGEMATRIX=(2 5), ELEMENT=(4 1), GUTTER=(0.188 0), $ENDSTYLEEND
Copyright 2007, Information Builders. Slide 3232
Copyright © 2004 Information Builders, Inc.