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

How to create a Manual Cross tab 1

Status
Not open for further replies.

gkw123

Programmer
Jan 21, 2011
14
US
Hi,
I'm new to crystal reports and I have to create a report that has to display data both down and across, similar to a crosstab. I tried using a crosstab but am unable to format it the way I want. The report looks like this

Name1 Name2 Name3 ......
requirement1 status1 status2 status3 ....
requirement2
requirement3
requirement4
.
.
.

Many to many relationship between Name and Requirement fields.
I found out that there is a way to create manual crosstabs.
I think I might be able to solve the problem that way.
If anyone knows how could you please help me with this?
If I am not clear enough please let me know.
thanks


 
First please explain whether you have one field called {table.name}, one called {table.status}, and one called {table.requirement} versus multiple fields for each. Also identify your summary field and the type of summary.

Then explain what problems you had with formatting when you tried an inserted crosstab. What you are showing does not look like a good candidate for a manual crosstab.

-LB
 
Hi,
Sorry if I wasn't clear enough. This is my first post on a forum and I had difficulty explaining my problem.

Let me show you exactly what I mean. The data coming from the database looks like this.

table.Name table.Requirement table.Status
ABC SDF Y
ABC FGH N
ABC HJK Y
ABC TYU Y
XYZ SDF N
XYZ FGH Y
XYZ TYU N


My job is to display the {table.name} horizontally and the {table.requirements} vertically and obtain the {table.status} for each requirement where the corresponding name and requirement intersect. For the above data the report should look like this.

ABC XYZ

FGH N Y
SDF Y N
HJK Y
TYU N Y

I had trouble with the cross tab expert because it always shows a 'total' field and I cannot format it the way I want. What other approach can I take if a cross tab can't do this for me?
Thank you,
gkw











 
Insert the crosstab, use name as the column field, requirement as the row field, and maximum of status as the summary field. Then go to the customize style tab (still in the crosstab expert)->check "suppress row totals" and "suppress column totals". If there are some other formatting issues you are having, you need to spell them out.

-LB
 
Hi,
I tried doing that and it works fine except for one problem.
I want to display all the requirements each time but the cross tab only displays those requirements which have values.For example the report should look like this

ABC XYZ
FGH Y
SDF N
HJK
TYU

But the cross tab looks like this

ABC XYZ
FGH Y
SDF N


There are 8 requirements and all have to displayed all the time. Is there a way to hard code the requirements and display the rest in a cross tab?
By the way thanks a lot for your help
I really appreciate it,
gkw
 
Another thing about the grid,
The grid is supposed to run across the whole page.
Even if there are only two names, there should be spaces on the grid throughout the rest of the page.
Thanks,
gkw
 
In order to show all requirements, you would have to use a left join FROM the table containing all requirements TO any other tables, with no selection criteria on the other tables. However, you still will not get empty grid cells beyond the two names. Are the names always the same? Waht is the maximum number of names? What is the maximum number of requirements? You could use conditional formulas or running totals to create a grid in the report footer, but this only makes sense if there are limited values. Or if you can get the requirments all to display, you could use a manual crosstab if there are not too many names.

-LB
 
Hi,
There are a total of 8 requirements and all 8 have to be displayed each time. However, there is no limit to the number of names, and the names are not the same. I have tried using running totals to create a grid as you mentioned but am not getting the results the way I want and am running into trouble with that. The problem is there are multiple records with the same name in the database and I cannot seem to get more than one requirement for each name.
Can I just hard code the requirements and use a manual cross tab for the name and status fields? If so where can I learn how to do that?
 
You could handle this better if you were willing to have the requirements as the column field and the names as the rows. Then you could just create one conditional formula per requirement, as in:

//{@ABC}:
if {table.req} = "ABC" then
{table.status}

Repeat for the other 7 requirements and place these in the detail section. Insert a group on name and then insert a maximum on each formula at the group level. Then drag the groupname into the group footer and suppress the group header and detail section. This assumes there is only one status per name per requirement.

-LB
 
I will ask my supervisor if that will be acceptable.
I hope it is. Thanks a lot for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top