Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditional formatting Cross tab

Status
Not open for further replies.

DrHabi

Technical User
Jan 22, 2002
103
US
I am trying to see if I can have every other column have a background gray. Is this possible? I also would like repeat column names after ROw 1, is this possible. Using CR11
Thanks
jim
 
Do you mean vertical stripes then? Please also identify your row, column, and summary field, and give an example of what you mean by repeating column names after row 1.

-LB
 
I would like to have verical stripe for each row on the cross tab so when the next column it is clear then next grey. I just don't see any refences to Column formatting. On this report each column is identifed by a location abbreviation. The client would like to see the columns names after the grouping of Row1 which is a Type group so when the Row is created that it dispalys that columns names. I pretty much believe that this will not be possible. I just don't create many cross tab reports since I am always limited in formatting options. I would rather hard code columns so I can use specialized formatting but in this case I have no choice but use a cross tab.
 
In the crosstab expert what are the field names for the column, the row, and the summaries?

Can you verify that you want the colors to be like this?

Loc1 Loc2 Loc3 Loc4
A [red]123[/red] 234 [red]345[/red] 456
B [red]122[/red] 333 [red]332[/red] 233
C [red]245[/red] 344 [red]345[/red] 455

I do not understand waht you mean by showing column names below row1. The column names in my example above would be:
Loc1 Loc2 Loc3 Loc4

-LB
 
yes that is the formatting I am looking . How do you do it?
this is what I am looking for in the other issue:
Loc1 Loc2 Loc3 Loc4
Dbtype X A 123 234 345 456
Dbtype X B 122 333 332 233
Dbtype X C 245 344 345 455
totals 1223 1132 1123 1233
Loc1 Loc2 Loc3 Loc4
Dbtype y A 123 234 345 456
Dbtype y B 122 333 332 233
Dbtype y C 245 344 345 455
totals 1223 1132 1123 1233
Loc1 Loc2 Loc3 Loc4
Dbtype z A 123 234 345 456
Dbtype z B 122 333 332 233
Dbtype z C 245 344 345 455
 
Create a formula {@concat}:

whilereadingrecords;
numbervar cnt;
stringvar x;

if instr(x,{table.loc}) = 0 then
(
cnt := cnt + 1;
x := {table.loc};
);
totext(cnt,0,"") + " "+x

...where {table.loc} is your location field. Use {@concat} as your column instead of your current column in the crosstab, and while it is selected, go to group options->options tab->customize group name->use a field: {table.loc}.

Then in preview mode, select the inner cells of the crosstab->right click->format field->border->color->background->x+2 and enter:

if remainder(val(left(gridrowcolumnvalue("@concat"),2)),2) = 0 then crGray else crNoColor

On the second issue, two things. First you will not get a repeated value in the first column because it is not unique, but if you make the A,B,C row the row #1, and make dbtype row #2, you should get repeated values. Or alternatively, add the ABC row field first, then the dbtype, then the ABC row field again, and just suppress the first row in the display.

The display wiht repeated column names can be achieved by putting the crosstab in a group section based on dbtype instead of in a report header or footer. If you cannot do this because you are already using these sections, you could insert a subreport to contain the crosstab, where you insert a group on dbtype and place the crosstab there. You will still need to do the above to get the repeated rows names though.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top