Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Best way to do this report? Post Reply Post New Topic
Page  of 2 Next >>
Author Message
Hwach
Newbie
Newbie


Joined: 14 Jul 2014
Online Status: Offline
Posts: 9
Quote Hwach Replybullet Topic: Best way to do this report?
    Posted: 14 Jul 2014 at 5:55am
Hi Everyone,

First post here!

Basically I have to make a report which uses the same table and the same fields multiple times.
The general structure is like so;

Machine Name--------Group 1
Operator Name---- Group 2
Total Operation length, Total Operation length for Maintenance, Total Operation length for Break, etc

So these come from my table. As an SQL query, I can do:

SELECT *
FROM Operations
WHERE Operations.Operation like '%maint%'

This is what I need but for the different operations. What is the best way to go about this? I thought of subreports but I have the feeling it may cause serious performance issues as the Machine is in another table so I have to link through another table to get to it;

machinetable -> recordedTime -> Operations

Extremely Confused with it all at the moment, so any response would be great.

Thanks


IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 14 Jul 2014 at 7:00am
you can add a select statement to include all of the 'types' you want,
group on the the type as the 3rd group and add your operation lengths for at group 3
or consider a Cross tab in the the group level 2 using the 'type' as the row grouping and the calculation as the sum of the time
IP IP Logged
Hwach
Newbie
Newbie


Joined: 14 Jul 2014
Online Status: Offline
Posts: 9
Quote Hwach Replybullet Posted: 14 Jul 2014 at 9:14pm
Hi,
This is what I'm going for, it needs to show the totals of each operation on the same report. I have tried it with subreports, but its excruciatingly slow.
[IMG]http://s27.postimg.org/tf4t647lf/crystal.png" />

So the first suggestion wont be possible unfortunately.

W̶h̶a̶t̶ ̶i̶s̶ ̶a̶ ̶C̶r̶o̶s̶s̶ ̶T̶a̶b̶?̶

EDIT: Looked at cross tabs, however, I'm not sure how to use this to select different rows based on another field.

Edited by Hwach - 14 Jul 2014 at 9:31pm
IP IP Logged
Gurbs
Senior Member
Senior Member
Avatar

Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
Quote Gurbs Replybullet Posted: 16 Jul 2014 at 11:23pm
You could try to make a formula for the different totals that you are looking for. Say you want to count the number of times where operations.operation like '%maint%'.

if {operations.operations} like '%maint%' then 1 else 0

Then create a sum of this formula.

You can create a formula like this for every field that you need the totals for.
IP IP Logged
Hwach
Newbie
Newbie


Joined: 14 Jul 2014
Online Status: Offline
Posts: 9
Quote Hwach Replybullet Posted: 16 Jul 2014 at 11:56pm
Let me try that, seems like a good way to do it!
IP IP Logged
Hwach
Newbie
Newbie


Joined: 14 Jul 2014
Online Status: Offline
Posts: 9
Quote Hwach Replybullet Posted: 17 Jul 2014 at 12:15am
if {Operations.Operation} like '%maint%' then {Operations.OperationLength} else 0


Tried this and yours however they are all showing as 0

I thought this might work;
if instr({TimeSheetEntries.Operation},"%maint%",1)>0 then {TimeSheetEntries.OperationLength} else 0


However it shows random quantities for everyone...
IP IP Logged
Gurbs
Senior Member
Senior Member
Avatar

Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
Quote Gurbs Replybullet Posted: 17 Jul 2014 at 12:22am
Place the field {operations.operation} directly into your report to see the exact values. The first formula should work, as I am using it myself in several reports as well.

Edit: Make sure that the values is exactly the same (case sensitive)

Edited by Gurbs - 17 Jul 2014 at 12:30am
IP IP Logged
Hwach
Newbie
Newbie


Joined: 14 Jul 2014
Online Status: Offline
Posts: 9
Quote Hwach Replybullet Posted: 17 Jul 2014 at 12:51am
I think I have got this working now using the crosstab, only issue is the lack of customisation that it offers.. I want to add an extra summary to the table showing the hours as a percentage of their total time, is this do-able?

Edit: Nevermind, found out how to do this

Edited by Hwach - 17 Jul 2014 at 12:53am
IP IP Logged
Hwach
Newbie
Newbie


Joined: 14 Jul 2014
Online Status: Offline
Posts: 9
Quote Hwach Replybullet Posted: 17 Jul 2014 at 11:32pm
Okay I seem to be having an issue where it is not pulling in all of the columns. I have it setup by X=Operation, Y= OperatorName and they are summarised by length. For some reason, it pulls 2 or 3 per machine when there is actually more operations with time recorded against it stored in the database...

Edited by Hwach - 17 Jul 2014 at 11:32pm
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 18 Jul 2014 at 3:30am
1. if you are doing a table join in your data source the join may limit your data set. Note that crysal joins are not enforced unless you set them as so or you use fields from both tables (or end points in daisy chained joins).
2. check your select statement
IP IP Logged
Page  of 2 Next >>
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.023 seconds.