New but learning!. Using Crystal Reports for this task
I am trying to do a complicated report but I am breaking it down to some manageable questions piece by piece. I have a table for Work orders. I need to start my report by listing all the different departments with in the Work Order Table whit a count of how many work orders by department .. then for each Department a sub report of the different status of Work Orders and count. It seems simple but i keep on getting a count of 1.
What I have done:
Started a new report
Added in WOCATEGORY (Departments)
-selected that field and chose the sigma button to
sum that field
Added a sub report
- addded in WOCATEGORY
- added in STATUS
- chose Select Expert and chose {Status} =
"Closed"
- Chose STATUS and selected that field and chose
the sigma button to sum that field
Added a sub report
- addded in WOCATEGORY
- added in STATUS
- chose Select Expert and chose {Status} =
"OPEN"
- Chose STATUS and selected that field and chose
the sigma button to sum that field
What i end up with is list of all my departments with no count, status of closed with not count and a status of open whit a count of 1?
I need to list all the differet types of Work Orders not just open and closed as well...?
Thanks for you help!
liked are a few photos that might help describe what is above.
Preview
Design
This is what worked for me with some help..
the insert summary button (Sigma button) and
pick the field as WorkerID
Type as DistinctCount
location = Group 1 (repeat for group 2).
This will insert a summary field into each group footer that you select. You can drag it into the header group header.
Related
I'm very new to crystal reports and my code issue isn't to complex, but I'm struggling find the right structure.
I have jobID's that all start with the same first 5 digits if they come from the same SalesOrderID. the five digits they start with are the salesID number.
I want to display all of the JobIDs under a SalesOrderID if the production is complete on just one of them.
if {Jobs.jmpProductionComplete} =-1.00
then
(
If {Jobs.jmpJobID} startswith left({Jobs.jmpJobID},5)
then {Jobs.jmpJobID}
else ""
)
but that produced a error saying "The result of selection formula must be a boolean"
Next I tried:
if {Jobs.jmpProductionComplete} =-1.00 then
(
If {Jobs.jmpJobID} startswith left({Jobs.jmpJobID},5)
then not(isnull({Jobs.jmpJobID}))
)
But that only displayed the single JobID that has been marked Production Complete.
Next I tried:
Created a formula with this code:
left({Jobs.jmpJobID},5)
named it #jobidformula
Go to the Group Expert > Move this formula to the Group List
Suppressed the Group Header and footer
Go to Report > Selection Formulas > Group and used this code:
Minimum({Jobs.jmpProductionComplete}, {#jobidformula}) = -1
still didn't work. Any other pointers anyone can give me?
I figured it out!
I first made it so that my report only shows the JobIDs which production is complete grouped by salesOrderID
I made a subreport where the parameter was SalesOrderID
in the selection formulas I set it so that Production was not complete.
I lined them all up and vooila! It works without issue.
I have a view which shows data on crystal reports where I have fields like tariff,rental,shares,gross and net.My problem is if someone changes the tariff in database it would show 2 rows of the same record with different tariff which is normal behavior from database point of view but I want to suppress the field of monthly rental to 0 if the same id has different tariff or the rental is repeated in new record.
ID Tariff Rental
1 20 390
1 15 390
I want the field of Rental on reports to be suppressed if duplicates based on id.Currently I have used this formula in crystal report to check previous field data and suppress if duplicate.
{DatabaseField}=Previous({DatabaseField})
It is working fine but if the id is not same and the rental is repeated then also it will suppress which I don't want.I want it to suppress only for same id.
You have to write the formula into field suppress. (No need on suppress if duplicated)
On Rental Field
{ID} = previous({ID}) and {rental} = previous({rental})
If ID and Rental are same then only the Report will suppress Rental.
I guess this will work for you.
In Crystal Reports, right-click on the Details section and select Section Expert.
In the Section Expert dialog box, select the X + 2 button beside the Suppress command. The check box must remain unselected for this formula to work.
In the Formula Editor dialog box, create a conditional formula containing the Next function to evaluate the records for duplicate values and to suppress the Details line
example:
{Table.Databasefield}=Previous({Table.Databasefield})
I had to make a slight change to the formula in the solution by Janarthanan by adding parenthesis to make it work with Crystal XI.
I used:
{ID}=previous({ID}) and {rental}=previous({rental})
this formatting variation, which is presented in the edited question, helped me to solve a similar problem.
Put this in suppress formula of field to hide.
if {myTable.ID} = previous({myTable.ID}) then
true
else
false
I searched to get the required answer but not found exactly what iam looking for - please help me.
Please follow the steps i made in crystal report:
Using crystal report command (i created a query to get the required business number)
--> which gets 5 Business numbers
Note: Every business is having many receipt numbers (1st installment receipt, 2nd installment receipts... like that....) - these receipt details are stored in table_receipts.
In table_business - i have all details about business number, customer, product details...
Please understand the links:
table_business - table_customer - table_product - table_receipts
Relationship between tables are:
table_business.Bno=table_receipts.Bno
table_customer.Cno=table_customer.Cno
table_product.Pno=table_product.Pno
After creating the crystal report command; i just drag the required table in crystal report (table_business, table_customer,table_product,table_receipts)
Now i created a group for Business Number "BNo"
I need to display all the required details about that selected Business Number using parameter - its coming fine except receipts.
I mean its showing all receipts (all installment receipts). I need to display only the first receipt only (i.e: receipt number starst with letter "F" )
Hope you understand my requirement - Please help me in this regard.
Expecting your valuable reply.
Regards,
Sensa.
Here is what I tried for the same issue and it worked. It's a 2 step process involving using Running Total Fields and Suppressing in Section Expert.
First step is to create a Running Total Field (Right under Parameter Fields)
Right click on it and click New and name your field i.e. CountFirstOnly
On the left you will see the fields you can perform functions on.
Select the receipts field. Bring that over to field to summarize and select count.
Under Evaluate select For Each Record
Reset on Change of Group and select your grouping, in this case business number and click OK
Drag that field into your report.
Part 2: Section Expert
Bring up the section expert on details and click on the suppress X-2 button
Your formula should be: CountFirstOnly >1
Click OK
Refresh your report
Hopefully this did the trick.
You should be able to do this by creating a forumla for suppressing the field (table_receipts.Rno).
Right-click the {table_receipts.Rno} field and select Format Field...Common tab...Check the 'Suppress' box and then click the X-2 box to the right. When the new window appears paste this:
not ({table_receipts.Rno} startswith "F")
I might have a solution for you.
1)Open the ‘Report’ menu then select ‘Section Expert’
2)Select the ‘Details’ section from the left hand menu
3)Tick the ‘Suppress No Drill-Down’ option and click on the icon to the right of it and in the formula option put
4)RecordNumber > 1
This should suppress the whole ROW/Record and not just the field. I saw your problem from this thread, I needed the exact same solution and this worked.
show only in the first row in crystal reports details section
It sounds as though the simplest way to meet this requirement would be to add a selection condition to the report - something like:
Left({table_receipts.Rno},1) = "F"
This should ensure that only the associated products and customers for the first receipt for each business are reported.
I am working on VS 2005. I am using 2 databases called student and group.
student (student_id,group_id(int))
group (group_id(int),group_name(varchar))
I have created a connection to the database.
Now I have to create the following report
Group Name Count
Biology 14
Computer Science 10
and so on
How do I go about it?
So, you want a report that groups by Group and counts the Students in each Group?
Insert a group in Crystal Reports on group_name.
Drag the student_id field to the Details section.
While the field is selected, right-click it and select Insert | Summary. Choose Count, then Group #1.
Right click in the margin to the left of the Details section and choose Hide.
Run the report.
Insert a summary field in the footer of each group which is a count of your primary key.
suppose if i have many locations like L!,L2,L3 etc
each location hasAmount column with many records
how
can i totl the amount of each location in Crystal report
You need to create a Group for the Location, and then add a total field for SUM of Amount.
If you need me to explan the steps for you, please feel free to ask.
On the menu click Report and then
Group Expert.
A new window will pop up called
Group Expert with 2 boxes (Available Fields and Group By) and
buttons to move fields from left to
right.
Move the Location Field to the Group
By box and click OK.
Now you report should show a Group
Header 1 containing a field *Group1 Name* and Group Footer 1 which should be blank.
Now on the menu click Insert and
Summary. You should see a new window called Insert Summary.
In the Choose the field to
Summarize, change the field to the required Amount field to be summed.
Change the Calculate this summary
from Maximum to to Sum.
Change the Summary Location from
Grand Total(Report Footer) to Group #1 and click OK.
That should be about it. Now you can play around with the formatting as required.