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
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!!!