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

Crosstab - Create several columns in one row 2

Status
Not open for further replies.

MDTekUser

Technical User
Dec 25, 2005
68
US
I am trying to create a crosstab that has two column headers. I want to be able to show them on row row. Instead what happens is that it automatically builds a hierarchy of one column on top of the other.

How do I get the crosstab to show two column headers on one row?

Column1 Column2
Status

Instead of:
Column1
Column2
Status
 
What are your column fields and the possible instances? Multiple columns are nested, so that it seems like this would only make sense if there were only one instance per column.

-LB
 
I'm creating a crosstab displaying criticality of errors per build of a software release. The fields I have in this report are Build, Severity and TOR (Test Observation Report). Each are separate columns in the database.

The report I am trying to create would look like this:

Critical Major Minor TORs
3.2.1 0 5 2 1
3.2.2 8 4 4 3

Severity is a column with possible values of Critical, Major or Minor. Then you have a column TOR that is yes or no. I am trying to count the number of TORS for each release in the same row as the severity, instead of it being on top.
 
You'll be better served to post technical information rather than trying to describe it:

Crystal version
Database/connectivity used
Example data
Expected output (based on the example data)

Also state whether you are allowed to create database objects.

I would guess that what you want is to move your columns to rows as your display shows that you want multiple rows, not columns.

The definition of Columns means alongside each other, not one below the other, hard to know from what little you've posted.

-k
 
I think what I am going to do is build a crosstab type stored procedure in SQL Server then just run the report off of that, which will give me various column totals in one row. Then I'll base my report off of that. As I stated before, I need various column totals on one line, instead of nested column totals.

Crystal Version: 10.0 Professional
Database Version: SQL Server Express 2005
Able to create database objects: YES

tbl_Test_Results
[DefectID] Identity field
[Build] (3.2.1,3.2.1, etc)
[Severity] (Minor,Critical, Major)
[TOR] (y/n)
 
The CR version is critical. In CR XI (and maybe in some lower versions), you can go into the customize style tab of the crosstab expert and check "show summaries horizontally" and also "Show summary labels". If you have this capacity, then only use Severity as a column field, and then add two summaries: your original summary, and then sum a formula for your second summary:

if {table.TOR} = "yes" then 1

Then you can suppress the inner cells, totals and column labels for the TOR summary, and suppress the row summary labels, cells, and total for the severity field. Resize the suppressed columns to minimize them.

-LB
 
Yeah, you're better served to do everything you can on the database and then use Crystal as the presentation layer, however if you build out the cross-tab in the SP, do so to allow for just using standard groups and details in Crystal rather than building it to suit a Crystal cross-tab.

This will promote reusability of it in other products in the future, such as MS Reporting Services ;)

-k
 
Thanks for your reply. You've presented some great ideas. I looked in the customize style tab but did not see "Show summaries horizontally" but I see a Summarized Fields option group that shows vertical or horizontal orientation. However it's grayed out or disabled unfortunately. It's defaulting to Vertical.
 
Ok, I finally fixed the problem. I had to add the count of TOR to the Summary Field box instead of the Column header box. I then suppressed the relevant totals to achieve what I needed.

Thanks a million and sorry for any ambiguity in my earlier descriptions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top