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!

Formatting crosstab in crystal reports 1

Status
Not open for further replies.

swetham

Programmer
May 5, 2010
257
DE
Hi,
I have a table which consists of
ConPack Region Trade Resource Duration Work_type
------- ------ ----- -------- -------- ----------
CP1 RG1 TR1 Res1 7 checking
CP2 RG2 TR2 Res2 9 Member
CP1 RG1 TR3 Res3 8 Member
CP2 RG2 TR4 Res4 4 Checking

I have created a cross tab like this,

Member Checking
Res3 Res2 Tot Res4 Res1 Tot
CP1 RG1 TR1 0 0 0 0 7 7
TR3 8 0 8 0 0 0
CP2 RG2 TR2 0 9 9 0 0 0
TR4 0 0 0 4 0 4

Now my problem is
1)I want the CP1, RG1 also to be printed in TR3 row and CP2, RG2 in TR4 row
2)I want the totals to be in the end with names as "Member tot" and "Checking tot"
3) Top of CP1 and RG1 i want to place a text object like "Trade" which describes that column. If i am placing it while exporting to excel formatting is very bad.

Can anyone help me how to slove these problems?

Thanks,
Ishu.



 
You could concatenate the three row fields:

{table.conpack}+" "+{table.region} + " " + {table.trade}

Then use the formula as your row field.

You can edit the column labels, so go into preview mode, and make the desired changes.

Adding the column title for the row labels is only possible by adding a text box which is difficult to align, or by adding a formula:

whilereadingrecords;
"Trade"

Then adding this as your first row field. This will place the label on the far left as a separate column. I like to rotate (90 degrees) and center the text and then make the column narrow. But this might not be something you want to do for exporting.

Finally, for total control, you could be creating a manual crosstab instead of using an inserted one.

-LB
 
Thank you so much for the immediate reply. I am new to crystal reports so i have so many doubts. Dont mind. Actually i placed a crosstab like In rows i placed conpack,region,trade. In columns i placed work type,res. In summary i placed duration. Now i created a formula like u said above {table.conpack}+" "+{table.region} + " " + {table.trade}, where should i place this formula. In the cross tab Row1,row2,row3 are of different widths. can you please tell me the exact place to place the formuls field.

How to create a manual crosstab? can u give me a example if possible?

 
I meant for you to use this as your ONLY row field. In your sample you showed fields with the same number of characters. There is a way to align if you know the maximum characters per field--let me know if you still want to do this.

For a manual crosstab, you would insert groups on Conpack, Region, and Trade and place the groupnames in the Trade Group Footer. Then create formulas like this (one for each combination of Member and Resource):

//{@MemberRES3}:
if {table.worktype} = "Member" and
{table.resource} = "RES3" then
{table.duration}

Place these formulas in the detail section and insert sums on them at the Trade group level. Then suppress the detail section. For the two totals, create formulas like this:

sum({@MemberRES3},{table.Trade})+sum{@memberRES2},{table.Trade}) //etc.

To ensure the desired export, attach each field to both vertical and horizontal guidelines, with neighboring fields sharing the same guideline, and then make sure the section borders are minimized.

-LB
 
Thank you for explaining clearly. I got the rows side by side. I will try the totals now. Thank you so much. Is there any way to move those totals to the end without using manual crosstab?
 
In the crosstab i have work_type as "member" and "checking" the columns will be grouped depending on the worktype first and res wise second. Now whileprintingrecords can i change the name of the member total as "mem_tot" and checking total as "check_tot"?
 
Sorry, I was wrong--you can't change the "Total" column label to reflect the value in the higher order column--but really this is unnecessary, since a viewer can see that the total belongs to that higher order column. Again, if this is important, a manual crosstab is in order.

You can change the totals so that they are at the right end by going into the customize style tab->uncheck "row totals on left".

-LB
 
I have one more doubt. in the bottom of every crosstab i want,

Production : 15 (member column total)
Checking :12 (checking column total)

How is it done?

Thanks,
sweish.
 
That should appear automatically as long as in the customize style tab you don't have "suppress column totals" checked. Of course, you will also see the totals for other columns, which you can suppress by right clicking->format field->suppress, if you wish.

-LB
 
Sorry i forgot that i posted the doubt in this original post. In the crosstab totals are coming. I need both in the crosstab and below of the crosstab
 
I have taken second crosstab without columns, I have got it but one problem is I want the work_type to be as member in first crosstab and while displaying in the second crosstab i want it as production. IS it possible?
 
Create a formula:

if {table.worktype} = "Member" then
"Production" else
{table.worktype}

Use this as your row field in the crosstab.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top