Jump to content

I report with text in the subfoot that I want to arrange int...


Peter Vazny

Recommended Posts

I report with text in the subfoot that I want to arrange into columns using style sheets. I want to employ macros to be able to easily adjust the width and style of individual columns. I have some lines though that have different items in them. Missing middle column, or using FIELD instead of TEXT for an ITEM.

For example:

"<FIELD11> Text11: <FIELD12> Text12: <FIELD13"

"<FIELD21> <+0> <+0> Text21: <FIELD22"

"<FIELD31><FIELD32><FIELD33> Text31: <FIELD34"

 

For desired effect:

Value11 Text11: Value12 Text12: Value13

Value21 Text21: Value22

Value31 Value32: Value33 Text31: Value34

 

I have five macros that align the five columns. Where I am running into problems is the third line. It looks like that even though I dong have any text in-between <FIELD31><FIELD32><FIELD33>, it still seems to insert text there and throw spacing off.

I wanted to know if there is some combination of styling settings that would allow me to set width to 0 or some other trick to hide a column in a way that it would not affect the other columns following it.

I will try to put something together later with car to show what I need.

Link to comment
Share on other sites

What I have used in the past is a DEFINEd columns or &Variable named SPACER. The Spacer column (or &SPACER variable) is set to blank. For Testing Ill set the SPACER Column to Spacer so I can see in testing and then set it back to blank. You can call the same SPACER value/column multiple times in the same row.

Alternatively, you can alternatively control the display color of the text to match the background color of your output. So if the background color = WHITE or BEIGE or BLACK just make the SPACER Text the same color as the background. Also, if you need spacers of varying length for whatever, reason you can just go with SPACERnnn where "nnn the length of that SPACER (a constant).

Link to comment
Share on other sites

david.beagan:

 

spot markers

 

 

Interesting. They seem to work in plain text format, but dont seem to affect anything in PDF or HTML. This will help me with my other problems, but I dont think it will work for me here. I did not mean to insinuate that I was using plain text, I just used plain text to illustrate my needs.

From Using Spot Markers to Refine Positioning:

 

You can also use spot markers to position heading and footing elements at fixed and relative column locations. Several spot markers control positioning based on the pre-defined width of a character in a monospace font. This is a legacy formatting technique that is not supported for proportional fonts.

Link to comment
Share on other sites

toby.mills:

 

Maybe try taking off your ending > sign adding it tells WebFOCUS to preserve the width of the column

 

 

I dont think that is the problem here. The reason I used it is to force the column to take up its whole width when printing using WP format. But I allowed enough space in my stylesheet to accommodate the whole column width. However, looking at the documentation I found:

 

Note: When a closing spot marker is immediately followed by an opening spot marker (><), a single space text item will be placed between the two spot markers (> <). This must be considered when applying formatting.

 

That might explain why there is text between these two fields: <FIELD32><FIELD33>. It is certainly not applied consistently, because there is no text between these two spot markers: <+0><+0>. Just annoying.

Link to comment
Share on other sites

As you point out from the Creating Reports manual a closing spot marker is immediately followed by an opening spot marker (><), a single space text item will be placed between the two spot markers (> <).

This single space becomes an item which moves the field to be the next item in the column.

Run the following code to see this, the colors help emphasize the point. Then uncomment the commented lines in the style sheet and run again. Works well for HTML, however, PDF still puts in one extra space for each, so doesnt seem workable for PDF.

-DEFAULT &WFFMT=HTML;

TABLE FILE ibisamp/ggsales

"<REGION><CITY><CATEGORY><PCD>"

"<REGION<CITY<CATEGORY<PCD"

" "

SUM SEQ_NO SEQ_NO SEQ_NO SEQ_NO

SEQ_NO SEQ_NO SEQ_NO SEQ_NO

BY REGION BY ST

ON TABLE PCHOLD FORMAT &WFFMT.(HTML,PDF,WP).

ON TABLE SET PAGE NOLEAD

ON TABLE SET STYLE *

TYPE=HEADING, ITEM=1, WIDTH=1, COLOR=MAROON, $

TYPE=HEADING, ITEM=2, WIDTH=1, COLOR=GOLD , $

-* TYPE=HEADING, ITEM=2, WIDTH=0, LINE=1, $

TYPE=HEADING, ITEM=3, WIDTH=1, COLOR=GREEN , $

TYPE=HEADING, ITEM=4, WIDTH=1, COLOR=RED , $

-* TYPE=HEADING, ITEM=4, WIDTH=0, LINE=1, $

TYPE=HEADING, ITEM=5, WIDTH=1, COLOR=BLUE, $

TYPE=HEADING, ITEM=6, WIDTH=1, COLOR=VIOLET, $

-* TYPE=HEADING, ITEM=6, WIDTH=0, LINE=1, $

TYPE=HEADING, ITEM=7, WIDTH=1, COLOR=PINK, $

TYPE=HEADING, STYLE=BOLD, $

ENDSTYLE

END

 

Another approach could be something like this:

-DEFAULT &WFFMT=HTML;

TABLE FILE GGSALES

" "

"<REGION> <20 Text11:<+0> <33 <ST> <40 Text13: <+0> <52 <CITY> "

"<PCD> <20 - <+0> <33 -<+0> <40 Text22: <+0> <52 <CATEGORY> "

"<STCD> <20 <PRODUCT> <33 <PCD> <40 Text14: <+0> <52 <CITY> "

" "

SUM SEQ_NO SEQ_NO SEQ_NO

SEQ_NO SEQ_NO SEQ_NO

SEQ_NO SEQ_NO SEQ_NO

BY REGION BY ST

ON TABLE PCHOLD FORMAT &WFFMT.(HTML,PDF,WP).

ON TABLE SET PAGE NOLEAD

ON TABLE SET STYLE *

TYPE=HEADING, ITEM=1, WRAP=1.2, COLOR=MAROON , $

TYPE=HEADING, ITEM=2, WRAP=0.1, COLOR=GRAY , $

TYPE=HEADING, ITEM=3, WRAP=1.2, COLOR=GOLD , JUSTIFY=RIGHT, $

TYPE=HEADING, ITEM=4, WRAP=0.1, COLOR=GRAY , $

TYPE=HEADING, ITEM=5, WRAP=1.2, COLOR=GREEN, $

TYPE=HEADING, ITEM=6, WRAP=0.1, COLOR=GRAY , $

TYPE=HEADING, ITEM=7, WRAP=1.2, COLOR=RED , JUSTIFY=RIGHT, $

TYPE=HEADING, ITEM=8, WRAP=0.1, COLOR=GRAY , $

TYPE=HEADING, ITEM=9, WRAP=1.2, COLOR=BLUE , $

TYPE=HEADING, FONT=ARIAL, STYLE=BOLD, $

ORIENTATION=LANDSCAPE, $

ENDSTYLE

END

 

It works for both HTML and PDF. The the number spot markers do affect the positioning in PDF though HTML ignores them.

Link to comment
Share on other sites

@david.beagan thank you. Your last solution is 99% there. HTML sill has some miss alignment issues, but I could live with them. However all of our reports use the default template ENIADefault_combine.sty to keep consistent look and when that is applied, HTML for no good reason miscounts the items.

Here I have changed nothing else but added the stylesheet:

 

image.png950248 6.48 KB

 

PDF still works right.

Another challenge that I am facing is that <40 in PDF is nowhere close to <40 in WP. It looks like PDF takes the width of the widest character and calculates the placement base of that. Which at 40 character is pretty significant gap.

Oh well, seems like there is no way to keep a unified document sans some dialogue manager stuff, which will then break the ability to edit in InfoAssist.

Thank you all, I am throwing in the towel.

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