Focal Point
[Solved]Wrap a long report into multiple columns

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

June 18, 2012, 11:20 AM
Todd_Wallace
[Solved]Wrap a long report into multiple columns
I am trying to change a 4 page report with 2 columns into a 1 page report that wraps the pages up into a 4 column single page report(with 8 data columns 2 per page).

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


WebFOCUS 8.1.05
Windows-iSeries DB2, All Outputs
HTML
June 18, 2012, 11:59 AM
Crymsyn
I am not sure if this is the best way but one way you can do this is by making an across field based on the row count.

Here is an example with the CAR table although I made it longer so won't have to make FIELD_1 or FIELD_2.

JOIN
FILE CAR AT COUNTRY TAG O1 TO MULTIPLE
FILE CAR AT COUNTRY TAG J1 AS J1
END
TABLE FILE CAR
PRINT
O1.COUNTRY AS 'CT1'
J1.COUNTRY AS 'CT2'
O1.MODEL AS 'MD1'
J1.MODEL AS 'MD2'
COMPUTE RNK/I7=RNK + 1;
ON TABLE SET ASNAME ON
ON TABLE HOLD AS TTT
END
-RUN
DEFINE FILE TTT
FIELD_1/A600=CT1 || '-' | CT2;
FIELD_2/A600=MD1 || '-' | MD2;

ACROSS_GROUP/I7=RNK/23;
-* The BY_GROUP is to put the across values on the same line by using modular division to only get the remainder
BY_GROUP/I7=IMOD(RNK,23,'I7');

-* If you want it to dynamically split it can comment out the above two defines and use the below.  Just change the 4 in the GROUPS_OF field to say how many columns you want.
-*GROUPS_OF/I7=(&LINES/4)+1;
-*ACROSS_GROUP/I7=RNK/GROUPS_OF;
-*BY_GROUP/I7=IMOD(RNK,GROUPS_OF,'I7');
END
TABLE FILE TTT
SUM
FIELD_1
FIELD_2
BY BY_GROUP NOPRINT
ACROSS ACROSS_GROUP NOPRINT
END

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


WF: 8201, OS: Windows, Output: HTML, PDF, Excel
June 18, 2012, 12:04 PM
susannah
html, i assume?
ok , split your output into 4 sections,
and display them side by side in an html table
eg:
TABLE FILE CAR
SUM SALES BY COUNTRY IF COUNTRY EQ 'ENGLAND'
ON TABLE HOLD AS MYTAB1 FORMAT HTML
END
TABLE FILE CAR
SUM SALES BY COUNTRY IF COUNTRY EQ 'FRANCE'
ON TABLE HOLD AS MYTAB2 FORMAT HTML
END

... etc for 2 more tables named MYTAB3 and MYTAB4
For your data, use some other filters, maybe make an extract with line numbers and just restrict to certain ranges
then...
-RUN
-HTMLFORM BEGIN
<HTML>
<TABLE>
<TR><TD VALIGN=TOP>
!IBI.FIL.MYTAB1;
<TD VALIGN=TOP>
!IBI.FIL.MYTAB2;
<TD VALIGN=TOP>
!IBI.FIL.MYTAB3;
<TD VALIGN=TOP>
!IBI.FIL.MYTAB4;
</TR></TABLE>
</HTML>
-HTMLFORM END

..get the idea?




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
June 19, 2012, 03:53 PM
Todd_Wallace
Thanks for the 2 suggestions. Crymsyn I have applied your solution and it seems to work very well. Susannah I could break the report into 4 pieces but the parts I'm reporting on are unique and change all the time so my page breaks would be uneven but I'll be sure to use that in the future if I have a nicely divided column.


WebFOCUS 8.1.05
Windows-iSeries DB2, All Outputs
HTML