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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Producing a Matrix Style report

Status
Not open for further replies.

Anastasis

MIS
Dec 15, 2004
27
GB
I have a requirement to produce a matrix style report.

Basically, this would be a number of cells (a bit like on a spreadsheet) that would be coloured based on certain data values. The labels for the matrix need to be down the left (for the rows) and across the bottom (for the columns). Something like can be seen here:


I thought a cross-tab report would fit the bill, but there is not a way of having the column labels along the bottom. Consequently, someone directed me to an article on how to produce a mock cross-tab report.

The example is in the article I have seen on this is OK, but the limitation it imposes means that whilst you can easily "mock" the rows by using a Group section, to provide the columns, you need to define their labels manually and a fixed number of them.

I need both the rows and column labels to be specified dynamically based on values in the tables and there can be any number (although in reality the matrix will be no smaller than 3x3 and no bigger than 12x12).

I am only just starting out with Crystal so maybe this is why it is causing me such a problem, but I really getting stuck on producing what I would think is a relativelly straightforward report.

Thanks in advance for any help you can give!
 
Let's assume you use a crosstab in the report header_a. You could place a second crosstab in an inserted report header_b section, and use the same column and summary fields, but no row field.

In the top crosstab, suppress the column labels, and the bottom crosstab, suppress the summary and row labels. Then in each crosstab, go the customize style tab->format grid lines->select the grid lines you want to eliminate and then uncheck "Draw" for each of these. You can increase the line width so that the crosstabs appear to share the line at which they meet.

You can also rotate the bottom column labels by right clicking on them in preview->format field->common->text rotation->90.

To get the conditional coloring in the cells, right click on the summary field while in preview->format field->border->background->x+2 and use a formula like the following:

if CurrentFieldValue in 1 to 3 then cryellow else
if CurrentFieldValue in 4 to 6 then crgreen else //etc.
crnocolor

-LB
 
Absolutely wonderful! Thank you so much for this and for your lateral thinking.

I'm almost there but am stumbling over one last thing. This is really off topic compared to the title of this thread so I will start a new one.

Thanks again!.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top