Focal Point
Coloring Columns

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

June 14, 2006, 02:38 PM
Rayden
Coloring Columns
Hi All,

This is probably cake, but I am having a hard time. I have a column on my report included in the sort using BY. This means it only has data in it intermittantly in a report. If I try and use BACKCOLOR, Excel only fills the cells in the column with color if they have data in them. Is there any way to get it to fill the entire column consistently regardless of there being data present?

I am using 5.3.1 on a NT server.

Thanks,

Rayden.


Web Focus version 7.1.4
Server Windows Server 2003
June 14, 2006, 04:36 PM
Jim_at_LM
We had this problem a while back and couldn't solve it. Try controlling the column shading to the color you want: TYPE=DATA, COLUMN=N2, WHEN N2 = ' ',$ (or: WHEN byfld eq ' ', $ )


WebFOCUS 7.6.11, WINDOWS, HTML, PDF, EXCEL
June 14, 2006, 07:11 PM
Mikel
Try using SET BYDISPLAY=ON

TABLE FILE CAR
  PRINT SALES
  BY COUNTRY
  BY CAR
  BY MODEL
  ON TABLE SET BYDISPLAY ON
  ON TABLE PCHOLD FORMAT EXL2K
END

Regards,
Mikel


WebFOCUS 8.1.05, 8.2.01
June 15, 2006, 04:18 AM
venu
If you don't want to turn the BYDISPLAY ON
Use the BYFIELD again under the PRINT verb with NOPRINT OPTION
Control the color of the displayed column based on the noprint column value.
June 15, 2006, 09:37 AM
Rayden
Hi All,

Thanks for all of your suggestions. I have tried them and still no luck. Here is my Fex:

-* File Rayden_Test.fex

TABLE FILE CAR
PRINT
COUNTRY NOPRINT
SALES
BY COUNTRY
BY CAR
BY MODEL

ON TABLE PCHOLD FORMAT EXL2K

ON TABLE SET STYLE *
UNITS=IN,
PAGESIZE='Legal',
LEFTMARGIN=0.000000,
RIGHTMARGIN=0.000000,
TOPMARGIN=0.000000,
BOTTOMMARGIN=0.000000,
SQUEEZE=ON,
ORIENTATION=LANDSCAPE,
$
TYPE=REPORT,
GRID=OFF,
FONT='ARIAL',
SIZE=9,
COLOR='BLACK',
STYLE=NORMAL,
RIGHTGAP=0.125000,
TOPGAP=0.013889,
BOTTOMGAP=0.027778,
$
TYPE=DATA,
FONT='LUCIDA SANS',
JUSTIFY=CENTER,
BACKCOLOR=SILVER,
$
TYPE=DATA,
COLUMN=N1,
BACKCOLOR=BLUE,
WHEN=N4 EQ 'ENGLAND',
$
TYPE=DATA,
COLUMN=N1,
BACKCOLOR=RED,
WHEN=N4 EQ 'FRANCE',
$
TYPE=DATA,
COLUMN=N1,
BACKCOLOR=AQUA,
WHEN=N4 EQ ' ',
$
TYPE=DATA,
COLUMN=N2,
BACKCOLOR=YELLOW,
$
TYPE=TITLE,
STYLE=BOLD,
SIZE=10,
BACKCOLOR='SILVER',
JUSTIFY=CENTER,
$
ENDSTYLE
END


Mikel - When I turn on BYDISPLAY the report prints the country/model in every cell in the by column, I need the by column to only contain data for the first row of records for the group, so that won't work for me.

Venu - I think I have implemented your suggestion, but this won't work either for some reason. In my example I am looking at the value in the NOPRINT column (which I am assuming will always contain data as it is not a BY field). The BACKCOLOR is conditionally displayed for column 1. If you run the Fex you will see I am still getting no color in the 1st two columns when the BY knows to not display data in the ROW. I was hoping the WHEN would capture this so I added another test for blanks and that is not catching anything either, unless the column cell contains some other value (NULL or something) that the WHEN is not testing for.

If anyone has any other ideas, I am open to them SmilerSmiler

Thanks again!

Rayden


Web Focus version 7.1.4
Server Windows Server 2003
June 15, 2006, 10:43 AM
JohnK
Rayden, If you want Aqua to print for all countries other than England or France then add a computed field and do your WHEN statement using it. Here is a revised version of your program.

TABLE FILE CAR
PRINT
COUNTRY NOPRINT
COMPUTE AQUA/A1=IF COUNTRY EQ 'ENGLAND' OR 'FRANCE' THEN 'N' ELSE 'Y';
SALES
BY COUNTRY
BY CAR
BY MODEL

ON TABLE PCHOLD FORMAT EXL2K

ON TABLE SET STYLE *
UNITS=IN,
PAGESIZE='Legal',
LEFTMARGIN=0.000000,
RIGHTMARGIN=0.000000,
TOPMARGIN=0.000000,
BOTTOMMARGIN=0.000000,
SQUEEZE=ON,
ORIENTATION=LANDSCAPE,
$
TYPE=REPORT,
GRID=OFF,
FONT='ARIAL',
SIZE=9,
COLOR='BLACK',
STYLE=NORMAL,
RIGHTGAP=0.125000,
TOPGAP=0.013889,
BOTTOMGAP=0.027778,
$
TYPE=DATA,
FONT='LUCIDA SANS',
JUSTIFY=CENTER,
BACKCOLOR=SILVER,
$
TYPE=DATA,
COLUMN=N1,
BACKCOLOR=BLUE,
WHEN=N4 EQ 'ENGLAND',
$
TYPE=DATA,
COLUMN=N1,
BACKCOLOR=RED,
WHEN=N4 EQ 'FRANCE',
$
TYPE=DATA,
COLUMN=N1,
BACKCOLOR=AQUA,
WHEN=AQUA EQ 'Y',
-**WHEN=N4 EQ ' ',
$
TYPE=DATA,
COLUMN=N2,
BACKCOLOR=YELLOW,
$
TYPE=TITLE,
STYLE=BOLD,
SIZE=10,
BACKCOLOR='SILVER',
JUSTIFY=CENTER,
$
ENDSTYLE
END

John K
June 15, 2006, 10:56 AM
Mikel
Rayden:

I just have tried your example with WF 7.1.1 and works fine. All Excel cells, including empty cells, are filled with BACKCOLOR.

Regards,
Mikel


WebFOCUS 8.1.05, 8.2.01
June 15, 2006, 02:36 PM
Rayden
Hi All,

Thanks again for all your input.

John: I Like the flag approach as it saves lines of code, but still does not fill in the empty cells in the column with color.

Mikel: I am using 5.3 , we are upgrading to 7.. in the next couple of weeks, so I will review again then.

Thanks again!

Rayden.


Web Focus version 7.1.4
Server Windows Server 2003