Print Page | Close Window

Totaling by Department

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22222
Printed Date: 30 Apr 2024 at 1:51am


Topic: Totaling by Department
Posted By: dmkanz
Subject: Totaling by Department
Date Posted: 03 Feb 2017 at 9:40am
I am trying to total a report by department but it is not working.

I have a report that is grouped by company, contract, department.

Inside the detail of the report is each contract item, department and amount

i.e.

10 - company
123456 - contract
02 - department
1 line item 02 department 500.00
2 line item 02 department 100.00

03 - department
3 line item 03 department 200.00
4 line item 03 department 50.00

04 - department
5 line item 04 department 25.00
6 line item 04 department 10.00

What I am trying to do is at the contract level - is total each department.

i.e.

10 - company
12345 - contract 02 600.00 03 250.00 04 35.00

I hope this makes sense - very new to the forum please excuse any formatting issues.

Thank you in advance



Replies:
Posted By: DBlank
Date Posted: 03 Feb 2017 at 9:47am
drop a crosstab in the GH or GF using the Department as a group option in that Crosstab


Posted By: dmkanz
Date Posted: 03 Feb 2017 at 9:58am
Okay - I am not familiar with Cross-Tabs. I will give it a try.


Posted By: dmkanz
Date Posted: 03 Feb 2017 at 10:06am
Is that the only way?

What I am trying to do is


Contract D1    D2     D3      Total
12345 - 600.00 250.00 35.00 - 885.00
67890 - 300.00 300.00 75.00 - 675.00

etc.


Posted By: DBlank
Date Posted: 06 Feb 2017 at 2:44am
it is the easiest way and most fluid, especially if you have dynamic data in the departments


Posted By: DBlank
Date Posted: 06 Feb 2017 at 2:45am
set the department as a grouped column field and the numeric field as a sum of the group


Posted By: dmkanz
Date Posted: 06 Feb 2017 at 5:24am
Thank you for the response. Is there a way to add another column for contract description?

12345 - ABC Contract 500.00 100.00 50.00 40.00 690.00

Thanks in advance


Posted By: dmkanz
Date Posted: 06 Feb 2017 at 5:30am
or change the column names to reflect the department name and not the number


Posted By: DBlank
Date Posted: 06 Feb 2017 at 6:00am
if you have the name in your data set you can just group on that instead. Or you have concatenate them like

totext(table.contractnumber,0,'')+':'+ table.contractname


Posted By: dmkanz
Date Posted: 13 Feb 2017 at 5:17am
Thank you for the response - that worked

Is there anyway to justify within the concatenated formula

ie

12345 Description (varies in length)    Project Mgr
67890 Description (varies in length)    Project Mgr

where the project manager column line up

right now I get

(current formula:
{Contract} & ' ' & {Description} & ' ' & {Name})


12345 Description Project Mgr
67890 Descrip Project Mgr

Thanks in advance


Posted By: DBlank
Date Posted: 13 Feb 2017 at 7:22am
You can add spaces to the end of each item and then do a LEFT(item,len) to select a standard length padding the right with a set number of spaces. You may still have to set the font or spacing to become standard.

Like
LEFT(contract + '     ',6) & LEFT({Description}+'              ',20) & {Name})


Posted By: dmkanz
Date Posted: 13 Feb 2017 at 9:57am
That worked. I needed to change the font like you suggested but they all line up now. Thanks again for all your help.



Print Page | Close Window