Focal Point
[SOLVED] Active Report - How to Create Gap/Padding Between Columns?

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

July 26, 2018, 11:37 AM
David Briars
[SOLVED] Active Report - How to Create Gap/Padding Between Columns?
My users are seeing an Active Report formatted report from the following code:
TABLE FILE CAR
  PRINT CAR NOPRINT
  COMPUTE FN/A50V = 'IMABROOKE'; AS 'First,Name'
  COMPUTE LN/A50V = 'TROUT';  AS 'Last,Name'
  ON TABLE PCHOLD FORMAT AHTML
  ON TABLE SET STYLE *
   TYPE=REPORT,GRID=OFF,FONT='Arial',SIZE=8,COLOR=RGB(50 50 50),$
   TYPE=REPORT,ALLOW-COMMENTS=OFF,$
   TYPE=REPORT,
    OBJECT=MENU,
    COLOR=RGB(53 78 109),
    HOVER-COLOR=RGB(53 78 109),
    BACKCOLOR=RGB(241 245 249),
    HOVER-BACKCOLOR=RGB(81 215 235),
    $
   TYPE=TITLE, JUSTIFY=CENTER,$
   TYPE=TITLE,SIZE=9,STYLE=-UNDERLINE+BOLD,BACKCOLOR=RGB(220 218 195),COLOR=RGB(134 10 39),
    BORDER-STYLE=OUTSET,BORDER=LIGHT,BORDER-COLOR=RGB(255 255 255),$
   TYPE=DATA,
    BORDER-LEFT-STYLE=NONE,BORDER-LEFT=MEDIUM,BORDER-LEFT-COLOR=RGB(255 255 255),
    BORDER-RIGHT-STYLE=NONE,BORDER-RIGHT=LIGHT,BORDER-RIGHT-COLOR=RGB(255 255 255),
    BORDER-BOTTOM-STYLE=NONE,BORDER-BOTTOM=LIGHT,
    BORDER-BOTTOM-COLOR=RGB(255 255 255),
    BACKCOLOR=( 'WHITE' RGB(227 232 238) ),
    $
   TYPE=REPORT,
    OBJECT=STATUS-AREA,
    JUSTIFY=CENTER,
    PAGE-LOCATION=BOTTOM,
    $
 ENDSTYLE
 END  


The 'E' of the First Name is smack tab too close to the first 'T' in Last Name for my users taste.

I cannot find anyway to put in a 'gap' between the two columns.

I really can't set specific width to one/both of the columns b/c in the next run the values could have more or less letters.

I also can't go to AUTOFIT, since my container is wide, and so then my columns would have too much of a gap. (Goldilocks where are you? :-))

Any/all ideas welcome.

This message has been edited. Last edited by: FP Mod Chuck,




Pilot: WebFOCUS 8.2.06 Test: WebFOCUS 8.1.05M Prod: WebFOCUS 8.1.05M Server: Windows Server 2016/Tomcat Standalone Workstation: Windows 10/IE11+Edge Database: Oracle 12c, Netezza, & MS SQL Server 2019 Output: AHTML/XLSX/HTML/PDF/JSCHART Tools: WFDS, Repository Content, BI Portal Designer & ReportCaster
July 26, 2018, 11:56 AM
Doug
Consider the use of TOPGAP, BOTTOMGAP, LEFTGAP, and RIGHTGAP in your stylesheet.

C/O Goldilocks




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
July 26, 2018, 12:39 PM
David Briars
Thanks Doug!

I think though those *GAP parms are more for PDF formatted reports, rather than AHTML.

Or at least that is what I think from reading the manual and trying them out.

I guess you can say I am shopping at Old Navy and not the *GAP. :-)




Pilot: WebFOCUS 8.2.06 Test: WebFOCUS 8.1.05M Prod: WebFOCUS 8.1.05M Server: Windows Server 2016/Tomcat Standalone Workstation: Windows 10/IE11+Edge Database: Oracle 12c, Netezza, & MS SQL Server 2019 Output: AHTML/XLSX/HTML/PDF/JSCHART Tools: WFDS, Repository Content, BI Portal Designer & ReportCaster
July 26, 2018, 02:12 PM
Tom Flynn
David,
Works for me in 7.7.05(Don't laugh too hard!) -
play around with the SQUEEZE value:

TYPE=DATA, COLUMN=N2, SQUEEZE=2, $

hth


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
July 26, 2018, 02:52 PM
David Briars
Thanks Tom.

I don't think I can set width of the 'First Name' column because I don't know necessarily how wide the values will be for any given report run.

So setting SQUEEZE = 2 works for the 'current value' of First Name.

And, as soon as, I have...:
  COMPUTE FN/A150V = 'IMABROOKEIMABROOKEIMABROOKEIMABROOKEIMABROOKEIMABROOKEIMABROOKE'; AS 'First,Name' 

...as the 'incoming value', I again have a teeny weeny gap between the columns.

{No problem still being on 77x, guessing you all have a lot of legacy apps that keep on keeping on, and don't necessarily need the 8x feature set. :-)}
July 26, 2018, 04:23 PM
Doug
Sorry about that David. I used the GAP in "ON TABLE HOLD AS REPORT1 FORMAT HTMTABLE" then did a simple HTMLFORM...

How about DEFINEing a "SPACE/A1 = ''" and placing it between the first and last names?
July 26, 2018, 04:44 PM
David Briars
Yep, did create a spacer column and place it in between the two displayed columns.

But, with Active, I get the 'upside down triangle' menu thingy, which would raise questions with the users like...Is there a column missing data?...
July 27, 2018, 09:56 AM
Tom Flynn
Hi David,
Well, you can find the max of the column length and set SQUEEZE accordingly? Just a thought...

  
DEFINE FILE IBISAMP/CAR
  COL1_LEN/I3 = ARGLEN(10, COUNTRY, COL1_LEN); 
  COL2_LEN/I3 = ARGLEN(16, CAR, COL2_LEN); 
  COL3_LEN/I3 = ARGLEN(24, MODEL, COL3_LEN); 
END
TABLE FILE IBISAMP/CAR
SUM
    MAX.COL1_LEN
    MAX.COL2_LEN
    MAX.COL3_LEN

ON TABLE HOLD FORMAT ALPHA
END
-RUN
-READ HOLD &COL1X.I3 &COL2X.I3 &COL3X.I3
-TYPE COL1 = &COL1X
-TYPE COL2 = &COL2X
-TYPE COL3 = &COL3X

-SET &COL1_SQ = IF &COL1X LE 10 THEN 1 ELSE
-               IF &COL1X GT 10 AND &COL1X LE 30 THEN 2 ELSE 3;
-TYPE Col 1 SQUEEZE Value: &COL1_SQ
-EXIT



Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
July 29, 2018, 08:24 PM
David Briars
Thanks Tom!

Yes, running through the dataset in order to support report time code creation is a great technique.

In my scenario though, I am looking for something a little more direct, as I have many columns in my report. And hopefully I can have something that can be applied by other developers, when the need for Active Report padding arises in other reports.

Thanks again.
July 29, 2018, 08:31 PM
David Briars
Looks like this is what the doctor ordered:
-* File ActiveReportColumnPadding.fex
TABLE FILE CAR
  PRINT CAR NOPRINT
  COMPUTE FN/A50V = 'IMABROOKE'; AS 'First,Name'
  COMPUTE LN/A50V = 'TROUT';     AS 'Last,Name'
  ON TABLE HOLD AS REPORT1 FORMAT AHTMLTAB
  ON TABLE SET STYLE *
   TYPE=REPORT,GRID=OFF,FONT='Arial',SIZE=8,COLOR=RGB(50 50 50),$
   TYPE=REPORT,ALLOW-COMMENTS=OFF,$
   TYPE=REPORT,
    OBJECT=MENU,
    COLOR=RGB(53 78 109),
    HOVER-COLOR=RGB(53 78 109),
    BACKCOLOR=RGB(241 245 249),
    HOVER-BACKCOLOR=RGB(81 215 235),
    $
   TYPE=TITLE, JUSTIFY=CENTER,$
   TYPE=TITLE,SIZE=9,STYLE=-UNDERLINE+BOLD,BACKCOLOR=RGB(220 218 195),COLOR=RGB(134 10 39),
    BORDER-STYLE=OUTSET,BORDER=LIGHT,BORDER-COLOR=RGB(255 255 255),$
   TYPE=DATA,
    BORDER-LEFT-STYLE=NONE,BORDER-LEFT=MEDIUM,BORDER-LEFT-COLOR=RGB(255 255 255),
    BORDER-RIGHT-STYLE=NONE,BORDER-RIGHT=LIGHT,BORDER-RIGHT-COLOR=RGB(255 255 255),
    BORDER-BOTTOM-STYLE=NONE,BORDER-BOTTOM=LIGHT,
    BORDER-BOTTOM-COLOR=RGB(255 255 255),
    BACKCOLOR=( 'WHITE' RGB(227 232 238) ),
    $
   TYPE=REPORT,
    OBJECT=STATUS-AREA,
    JUSTIFY=CENTER,
    PAGE-LOCATION=BOTTOM,
    $
ENDSTYLE
END
-RUN
-HTMLFORM BEGIN
<HTML>
<HEAD>
<TITLE></TITLE>
<style>
td[id^="I0r"] {
    padding-right: 20px !important;
}
</style>
</HEAD>
<BODY>
!IBI.OBJ.ACTIVEREPORTJS;
!IBI.FIL.REPORT1;
</BODY>
</HTML>
-HTMLFORM END   


I use the CSS padding property, and a CSS selector that selects the 'cells' of the Active Report.

I've put the CSS in a -INCLUDE, in case IB changes the identifiers of the cells, and if that is ever the case, I can easily adapt. Or if IB comes up with a StyleSheet attribute for column padding in Active Reports, again I could easily, given the -INCLUDE turn this CSS off.
July 30, 2018, 08:57 AM
Tom Flynn
Very Good David! Excellent idea, technique and process.
Well Done!!!


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
July 30, 2018, 10:16 AM
Doug
Ditto to Tom's reply...

td[id^="I0r"] {padding-right: 20px !important;}
 
May 15, 2019, 11:44 AM
Doug
Thanks, I forgot about using "JUSTIFY=CENTER" here:
quote:
TYPE=REPORT, OBJECT=STATUS-AREA, JUSTIFY=CENTER, PAGE-LOCATION=BOTTOM,$