Carter Henderson Posted November 22, 2022 Posted November 22, 2022 I have a report that has a lot of columns, such that when the report is exported to PDF, some of the columns are cutoff. I want to take the colums below and display half on one line and half on a line below it. Is this possible?
David Beagan Posted November 23, 2022 Posted November 23, 2022 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),$ ENDReference the Creating Reports with WebFOCUS Language manualhttps://docs.tibco.com/pub/wf-wf/9.1.0/doc/pdf/TIB_wfwf_9.1.0_cr_language.pdf#page=1649
Martin Yergeau Posted November 23, 2022 Posted November 23, 2022 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
Carter Henderson Posted November 23, 2022 Author Posted November 23, 2022 Thanks for the post David. I think this is close. I would ultimately like to have the format where it's one row of columns and then the data, another row of columns then the data. My report only has one row of data per column.
Carter Henderson Posted November 23, 2022 Author Posted November 23, 2022 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 STnortheast TNdate STCD1996/12/01 R1044Is that possible?I have looked at compound reports but don't know if that Thanks for your help
Carter Henderson Posted November 23, 2022 Author Posted November 23, 2022 The most recent image you sent me was the one I need. How did you create that?
Martin Yergeau Posted November 23, 2022 Posted November 23, 2022 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 imageWhich 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 belowIf 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.
Carter Henderson Posted November 23, 2022 Author Posted November 23, 2022 You are exactly right in your understanding and assumptions. I apologize for it not being clearer. And I would only do this where I have one row of data per title/column
Martin Yergeau Posted November 23, 2022 Posted November 23, 2022 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.
Carter Henderson Posted November 23, 2022 Author Posted November 23, 2022 I gotcha. Well, that's disappointing. The trouble is that PDF print out is so small because there are so many columns that it's basically unreadable. Could I format the PDF to print Landscape instead of portrait?Thanks for your help. I appreciate it.
Solution Martin Yergeau Posted November 23, 2022 Solution Posted November 23, 2022 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-RUNNote 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.
Carter Henderson Posted November 23, 2022 Author Posted November 23, 2022 That is impressive! Thanks again for taking the time to help me with this. Cheers!
Martin Yergeau Posted November 23, 2022 Posted November 23, 2022 Where do I send the bill ? 😂 😁 Was a pleasure to help. This is why the Cummunity exist.BTW, I kept that code in my personal library
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now