Focal Point
[SHARING] Column Title Formatting

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

April 23, 2010, 12:32 AM
Waz
[SHARING] Column Title Formatting
I was mucking around with MARKUP=ON, and found that you can style the column titles, in fact bits of the titles.

Have a look at this, the posibilities are quite interesting.

-SET &RELNO = EDIT(&FOCREL,'$$$$999') ;

-SET &_V71 = IF &RELNO GE 710 AND &RELNO LE 760 THEN '-*' ELSE '' ;
-SET &_V76 = IF &RELNO GE 760 THEN '-*' ELSE '' ;

TABLE FILE CAR
PRINT CAR   AS '[b]Car[/b],[i]Name[/i]'
      MODEL AS '[i]<u>M</u>odel[/i]'
&_V71.EVAL BY COUNTRY AS '<font face="arial" size=12 color=#FF9933>Country</font>,<font face="arial" size=8 color=#0066FF>Name</font>'
&_V76.EVAL BY COUNTRY AS '[b]Country[/b],<sup>Name</sup>'
ON TABLE PCHOLD FORMAT PDF
-*ON TABLE SET NEWLAYOUT ON
ON TABLE SET PAGE-NUM OFF
ON TABLE SET STYLE *
UNITS=CM, PAGESIZE='A4', LEFTMARGIN=0.635000, RIGHTMARGIN=0.635000,
    TOPMARGIN=0.635000, BOTTOMMARGIN=0.635000,
    SQUEEZE=ON,
    ORIENTATION=LANDSCAPE, $
TYPE=REPORT, FONT=ARIAL, SIZE=10, MARKUP=ON, $
END

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


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

April 23, 2010, 03:26 AM
GamP
That's nice, Waz. A perfect way of styling PDF components that defied styling using normal stylesheet commands.
I just had to change the [ and ] by < and > and it ran like a charm. Good One


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
April 23, 2010, 04:25 AM
Tony A
Excellent spotting Waz, and this gets my vote on a great tip!! Good One

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
April 23, 2010, 04:30 AM
Ram Prasad E
So nice Waz. By this we get more control over styling in PDF.


WebFOCUS 8.1.05
Windows
http://ibiwebfocus.wordpress.com
https://www.facebook.com/groups/ibi.webfocus/
April 23, 2010, 10:19 AM
njsden
quote:
this gets my vote on a great tip

Excellent tip, indeed! Good One Waz!



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
April 26, 2010, 05:37 PM
Waz
Thanks GamP for spotting the [] issue, I've fixed it up.

Good One

I assume the posting to the forum did it ??


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

April 27, 2010, 06:05 PM
Waz
quote:
Traps for young players


Be aware that if your data has
<char(s)>
it will be interpreted as a tag.

Seems that < char[s)> is OK. Note th space between the < and the char.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

April 28, 2010, 10:00 AM
Francis Mariani
Waz, thanks for this excellent tip!

Now, why didn't I know about this? I'll tell you why - it's not mentioned in the documentation, that's why!

"WebFOCUS Version 7 Release 6.5 introduced the ability to format any portion of the text entered in a text object on a report and hold it in PDF format."

This is from 'WebFOCUS New Features - Version 7 Release 6.9'. The syntax for "MARKUP" is nowhere to be found in the v7.6.5 or v7.6.8 documentation that I read before I go to bed every night.

The syntax finally shows up in the Summary of New Features for v7.6.9. Some interesting stuff has been added to v7.6.9:

"A report that contains markup tags in a text object is called a markup report. Starting with WebFOCUS Version 7 Release 6.9, a markup report can be generated as a PDF, DHTML, or PPT output file. A markup report does not have to be created in the Document Composer tool. You can use StyleSheet syntax to add drawing objects and markup tags to any report request saved in one of the supported formats.

In addition, in WebFOCUS Version 7 Release 6.9, an enhancement has been added to the markup syntax that enables you to adjust line spacing for a text object.

This new feature document describes the markup tags and options supported in WebFOCUS Version 7 Release 6.9."


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
April 28, 2010, 05:36 PM
Waz
quote:
it's not mentioned in the documentation


Well I didn't find it any place either. I'd used the tags in headings, then in data to solve a superscript issue. And I thought where else would this work, and bingo, there you are.

I wonder if it works in other places as well, like EMR, or data in SUBTOTAL, etc. It'll be interesting to test.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

March 07, 2011, 10:23 AM
JRLewis
I just came across this post, and thought it may be a possible answer to an issue that has troubled me at my client site.

We have reports on our dashboard are broken up by section, and we have been using column titles as section headers, since that is much simpler than other methods we have tried. In addition, we enable columns to be sorted by clicking on the column title, and we use stylesheet links to do this. So, the column titles always are the color blue and are underlined.

This is an example of what I am talking about:

TABLE FILE CAR
PRINT 
  COUNTRY AS 'Country'
  CAR AS 'Car 1,,Car'
  MODEL AS 'Model'
  COUNTRY AS 'Country'
  CAR AS 'Car 2,,Car'
  MODEL AS 'Model'
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=REPORT,GRID=OFF,$
TYPE=TITLE,COLUMN=N1,FOCEXEC=car,$
TYPE=TITLE,COLUMN=N2,FOCEXEC=car,$
TYPE=TITLE,COLUMN=N3,FOCEXEC=car,$
TYPE=TITLE,COLUMN=N4,FOCEXEC=car,$
TYPE=TITLE,COLUMN=N5,FOCEXEC=car,$
TYPE=TITLE,COLUMN=N6,FOCEXEC=car,$
END



The issue that we have is that the 'section title' portion of the column title also looks like a link, and we would like it to not show as a link. In other words, have it display as black and not underlined.

Using the technique in this post, I can have the 'section title' display in black, but I could not get rid of the underline. Can we use this technique to override the underline when a stylesheet link is used?


WebFOCUS 8
March 07, 2011, 10:49 AM
Tom Flynn
Try HEADING:

 
APP PREPENDPATH IBISAMP
-RUN
SET SHOWBLANKS = ON
-RUN
TABLE FILE CAR
HEADING
"                             Car 1<+0>                             Car 2"
" "
PRINT 
  COUNTRY AS 'Country'
  CAR AS 'Car'
  MODEL AS 'Model'
  COUNTRY AS 'Country'
  CAR AS 'Car'
  MODEL AS 'Model'
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=REPORT,GRID=OFF,$
TYPE=HEADING, HEADALIGN=BODY, COLSPAN=6, STYLE=BOLD, COLOR=BLACK,$
TYPE=HEADING, ITEM=1, COLSPAN=3, $
TYPE=HEADING, ITEM=2, COLSPAN=3, $
TYPE=TITLE,COLUMN=N1,FOCEXEC=car,$
TYPE=TITLE,COLUMN=N2,FOCEXEC=car,$
TYPE=TITLE,COLUMN=N3,FOCEXEC=car,$
TYPE=TITLE,COLUMN=N4,FOCEXEC=car,$
TYPE=TITLE,COLUMN=N5,FOCEXEC=car,$
TYPE=TITLE,COLUMN=N6,FOCEXEC=car,$
END
-EXIT



Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
March 07, 2011, 10:57 AM
<FreSte>
Or

  CAR AS '<font onclick="return false" style="text-decoration:none; color:black;">Car 1</font>,,Car'

March 08, 2011, 08:29 AM
JRLewis
FreSte, your solution works great! That is exactly what I was looking for.

Thanks for your suggestions!


WebFOCUS 8
November 15, 2019, 01:02 PM
JJ
I came across this post and it was so helpful. I want to use background color within title but it doesn't work. Below is the across title with formatting I have, can someone be able to help? Thank you!

ACROSS CRS_N AS '[b]<font face="arial">R - Waitlisted
X - Completed
E - Enrolled
<font color=rgb[0 0 0) background-color=rgb[127 176 0)>Green = Certified</font>
<font color=rgb[0 0 0) background-color=red>Red = Expired</font>
<span style="color:rgb[0 0 0);background-color:yellow;">Yellow = Needs work</span></font>[/b]'

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


WebFOCUS 8.2.05
Windows 2003
Excel, HTML, PDF
November 15, 2019, 01:09 PM
Hallway
quote:
Originally posted by JJ:
I came across this post and it was so helpful. I want to use background color within title but it doesn't work. Below is the across title with formatting I have, can someone be able to help? Thank you!

ACROSS CRS_N AS '[b]<font face="arial">R - Waitlisted
X - Completed
E - Enrolled
<+0><font color=rgb[0 0 0) background-color=rgb[127 176 0)>Green = Certified</font>
<+0><font color=rgb[0 0 0) background-color=red>Red = Expired</font><+0>
<span style="color:rgb[0 0 0);background-color:yellow;">Yellow = Needs work</span></font>[/b]'

Could you post a full example using the CAR file? I'm having a hard time understanding what this means


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
November 15, 2019, 01:52 PM
JJ
TABLE FILE CAR
PRINT CAR   AS '<b><font face="arial" color=black background-color=green>Car</font><br><font color=black background-color=red>Name</font></b>'
      MODEL AS '<b><font face="arial color=black background-color=yellow">Model</font>'

ON TABLE PCHOLD FORMAT EXL2K
ON TABLE SET PAGE-NUM OFF
ON TABLE SET STYLE *
UNITS=CM, PAGESIZE='A4', LEFTMARGIN=0.635000, RIGHTMARGIN=0.635000,
    TOPMARGIN=0.635000, BOTTOMMARGIN=0.635000,
    SQUEEZE=ON,
    ORIENTATION=LANDSCAPE, $
TYPE=REPORT, FONT=ARIAL, SIZE=10, MARKUP=ON, $
END


Background color doesn't work. Thank you!


WebFOCUS 8.2.05
Windows 2003
Excel, HTML, PDF
November 20, 2019, 01:21 PM
Hallway
Everything that I'm seeing in the docs shows that MARKUP=ON only works on text output objects like PDF or PPTX.

https://webfocusinfocenter.informationbuilders.com


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs: