Jump to content
The ibi Community has moved to a new platform: Please Sign In and choose Forgot Password to continue

Displaying columns on multiple lines


Carter Henderson
Go to solution Solved by Martin Yergeau,

Recommended Posts

One way would be to use the OVER command and HEADALIGN=BODY. An example with the ggsales file:

TABLE FILE ggsales HEADING "Seq.<+0>Region<+0>ST<+0>City<+0>Category<+0>PCD<+0>Product" "Date<+0> STCD<+0>Units<+0>Bud. Units<+0>Dollars<+0>Bud. Dollars" PRINT -* SEQ_NO AS '' REGION AS '' ST AS '' CITY AS '' CATEGORY AS '' PCD AS '' PRODUCT AS '' OVER DATE AS '' STCD AS '' UNITS/I9C AS '' BUDUNITS/I9C AS '' DOLLARS/I9M AS '' BUDDOLLARS/I9M AS '' OVER COMPUTE BLANK/A1 = ' '; AS '' BY SEQ_NO AS '' ON TABLE SET SQUEEZE ON ON TABLE SET PAGE-NUM NOLEAD ON TABLE PCHOLD FORMAT PDF ON TABLE SET STYLE * TYPE=REPORT, ORIENTATION=LANDSCAPE, FONT=ARIAL, SIZE=10, HEADALIGN=BODY,$ TYPE=HEADING, BORDER=LIGHT, BORDER-COLOR=SILVER, BACKCOLOR=RGB(245 245 245),$ END

image.png.777e6012f3b44f59524d52f2c6f3b34f.pngReference the Creating Reports with WebFOCUS Language manual

https://docs.tibco.com/pub/wf-wf/9.1.0/doc/pdf/TIB_wfwf_9.1.0_cr_language.pdf#page=1649

Link to comment
Share on other sites

Just to make David's sample more "aligned"

TABLE FILE GGSALESPRINT REGION AS '' ST AS '' CITY AS '' COMPUTE BLANK/A1 = ' '; AS '' CATEGORY AS '' COMPUTE BLANK/A1 = ' '; AS '' PCD AS '' PRODUCT AS '' OVER DATE AS '' STCD AS '' COMPUTE BLANK/A1 = ' '; AS '' UNITS/I9C AS '' COMPUTE BLANK/A1 = ' '; AS '' BUDUNITS/I9C AS '' COMPUTE BLANK/A1 = ' '; AS '' DOLLARS/I9M AS '' COMPUTE BLANK/A1 = ' '; AS '' BUDDOLLARS/I9M AS '' OVER COMPUTE BLANK/A1 = ' '; AS ''BY SEQ_NO AS '' HEADING"Seq.<+0>Region<+0>ST<+0>City<+0>Category<+0> <+0> <+0>PCD<+0>Product"" <+0>Date<+0>STCD<+0>Units<+0>Bud. Units<+0> <+0> <+0> Dollars<+0>Bud. Dollars" ON TABLE SET SQUEEZE ONON TABLE SET PAGE-NUM NOLEADON TABLE PCHOLD FORMAT PDFON TABLE SET STYLE *TYPE=REPORT, ORIENTATION=LANDSCAPE, FONT=ARIAL, SIZE=10, HEADALIGN=BODY, JUSTIFY=RIGHT,$TYPE=HEADING, JUSTIFY=RIGHT, BORDER=LIGHT, BORDER-COLOR=SILVER, BACKCOLOR=RGB(245 245 245),$END-RUN

image.png.b2bef8c21a77dd1c47ad081f63b050dc.png

Link to comment
Share on other sites

Thanks Martin. I like this alignment better and this might work. Ideally for readability, I would like it to be columns, data, columns, data. vs columns, columns, data, data. This report only has one row of data per column, as it is a report that looks at various metrics for one person. A sample would be ;

region ST

northeast TN

date STCD

1996/12/01 R1044

Is that possible?

I have looked at compound reports but don't know if that

Thanks for your help

Link to comment
Share on other sites

I am a little confused with your wording and request

"colmns" seems to refer to the heading/title for a data/value where "region" is the heading/title of data/value "northeast"

The report must display one row of data per person.

Speaking "normal" report display, it will look as the below image

image.png.3fd34509af02d012996df0fc47e574e3.pngWhich represent one row of data per Sequence#

Assuming that we are taking only Sequence# 1 row.

Then you would like to have, as per example, the first 7 columns (Seq#, Region, State, City, Category, Product ID & Product) displayed on one line and the others (with their own title) on another line ?

Something such as below

image.png.26fa4d0042d20348f87bac48366c60fa.pngIf I am right on the assumption, I doubt that this is possible.

heading/title are normally displayed only once per page.

To have more heading/title on the same page, you must have a "break" somewhere.

Link to comment
Share on other sites

This is a fake report : image capture positioned as expected.

Not sure that it is possible to do.

I was just trying to figure what is your need.

As I mentioned, column's title (Date Store ID Unit Sales, ...) exist normally only once per page except with a "break".

But even that, a "break" will repeat the same titles, not adifferent as per my fake sample.

Link to comment
Share on other sites

  • Solution

OMG !!!!!

I never thought that i will be able to do that, but I DID !!!!

Another proof that we can do almost anything with WF !!!

However, not sure that it's going to be possible without doing all in the code....

TABLE FILE GGSALESPRINT COMPUTE FLD1 /A50V = RJUST(50, TRIM_(BOTH, ' ', REGION), 'A50V'); COMPUTE FLD2 /A50V = RJUST(50, TRIM_(BOTH, ' ', ST), 'A50V'); COMPUTE FLD3 /A50V = RJUST(50, TRIM_(BOTH, ' ', CITY), 'A50V'); COMPUTE FLD4 /A50V = RJUST(50, TRIM_(BOTH, ' ', CATEGORY), 'A50V'); COMPUTE FLD5 /A50V = RJUST(50, TRIM_(BOTH, ' ', PCD), 'A50V'); COMPUTE FLD6 /A50V = RJUST(50, TRIM_(BOTH, ' ', PRODUCT), 'A50V');BY SEQ_NOBY TOTAL COMPUTE ROWID /I1 = 1;ON TABLE HOLD AS PART1END-RUN TABLE FILE GGSALESPRINT COMPUTE FLD1 /A50V = RJUST(50, TRIM_(BOTH, ' ', FPRINT(DATE, 'I8YYMD', 'A12')), 'A50V'); COMPUTE FLD1 /A50V = RJUST(50, TRIM_(BOTH, ' ', STCD), 'A50V'); COMPUTE FLD1 /A50V = RJUST(50, TRIM_(BOTH, ' ', FPRINT(UNITS, 'I9C', 'A12')), 'A50V'); COMPUTE FLD1 /A50V = RJUST(50, TRIM_(BOTH, ' ', FPRINT(BUDUNITS, 'I9C', 'A12')), 'A50V'); COMPUTE FLD1 /A50V = RJUST(50, TRIM_(BOTH, ' ', FPRINT(DOLLARS, 'I9M', 'A12')), 'A50V'); COMPUTE FLD1 /A50V = RJUST(50, TRIM_(BOTH, ' ', FPRINT(BUDDOLLARS, 'I9M', 'A12')), 'A50V');BY SEQ_NOBY TOTAL COMPUTE ROWID /I1 = 2;ON TABLE HOLD AS PART2END-RUN TABLE FILE PART1PRINT FLD1 FLD2 FLD3 FLD4 FLD5 FLD6BY SEQ_NOBY ROWIDON TABLE HOLD AS FINALDATAMOREFILE PART2END-RUN TABLE FILE FINALDATAPRINT FLD1 AS '' FLD2 AS '' FLD3 AS '' FLD4 AS ''COMPUTE DUMMY /A1 = ''; AS '' FLD5 AS '' FLD6 AS ''BY SEQ_NO AS ''BY ROWID NOPRINTON ROWID SUBHEAD"Seq.<+0>Region<+0>Sate<+0>City<+0>Category<+0> <+0>PCD<+0>Product"WHEN ROWID EQ 1 ON ROWID SUBHEAD" <+0>Date<+0>STCD<+0>Units<+0>Bud. Units<+0> <+0>Dollars<+0>Bud. Dollars"WHEN ROWID EQ 2 ON ROWID SUBFOOT""WHEN ROWID EQ 2 ON TABLE SET SQUEEZE ONON TABLE SET PAGE-NUM NOLEADON TABLE PCHOLD FORMAT PDFON TABLE SET STYLE *TYPE=REPORT, ORIENTATION=LANDSCAPE, FONT=ARIAL, SIZE=10, HEADALIGN=BODY, JUSTIFY=RIGHT,$TYPE=SUBHEAD, BORDER=LIGHT, BORDER-COLOR=SILVER, BACKCOLOR=RGB(245 245 245),$ENDSTYLEEND-RUN

image.png.845a56ef328823f18634b2a7c6034be4.pngNote that the report formating does work for this data set ONLY.

As you can see, I have played a lot with field and report format to have the data properly aligned.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...