johnstrang
Technical User
Hi,
Using CR 8.5 connected to an Oracle database.
I have a request to develop a report giving various information on orders received in my company.
We need the orders selected by
- Service (each order is for 1 service only)
- Week Number
- Type (either New, Change, Cease)
Report Layout to be like this:
Part of the problem is this is already a subreport (the main report has details on the individual orders, and various other summaries) so I cannot use a further subreport.
What I have done is have 2 subreports, one for weekly and one for cumulative.
This works fine - all the totals and %ages are correct. The only problem I have is that there are services which have NO orders in some weeks so they don't appear in the "weekly" subreport.
Is there a way to incorporate both in just 1 subreport? I can do it apart from calculating the %age in the "Weekly" one, because I have to use a formula for calculating the week number:
which means that to obtain the counts for the "weekly" side I have to use a formula like
Note that I am not looking for detailed help with formulas etc, just a pointer in the right direction.
I have been told that "everythng is possible" with Crystal reports if only you can think of how to do it.
Many thanks for taking the trouble to read this, please let me know if I have nmissed anything.
John
Using CR 8.5 connected to an Oracle database.
I have a request to develop a report giving various information on orders received in my company.
We need the orders selected by
- Service (each order is for 1 service only)
- Week Number
- Type (either New, Change, Cease)
Report Layout to be like this:
Code:
!--------Week---------! !------Cumulative------!
Service New Change Cease New Change Cease
S1 5 50% 1 25% 1 33.3% 20 40% 4 40% 2 40%
S2 2 20% 2 50% 1 33.3% 15 30% 2 20% 1 20%
S3 3 30% 1 25% 1 33.3% 15 30% 4 40% 2 40%
TOTALS 10 4 4 50 10 5
What I have done is have 2 subreports, one for weekly and one for cumulative.
This works fine - all the totals and %ages are correct. The only problem I have is that there are services which have NO orders in some weeks so they don't appear in the "weekly" subreport.
Is there a way to incorporate both in just 1 subreport? I can do it apart from calculating the %age in the "Weekly" one, because I have to use a formula for calculating the week number:
Code:
datepart("ww", {ORDER.CREATION_TIME} + 7, crMonday) - 1
which means that to obtain the counts for the "weekly" side I have to use a formula like
Code:
whileprintingrecords;
if {ORDER.ORDER_TYPE} = "New Installation" and {@order_week_number} = maximum({@order_week_number}) then
(
numbervar week_new := week_new + 1 ;
numbervar tot_week_new := tot_week_new + 1 ;
)
Note that I am not looking for detailed help with formulas etc, just a pointer in the right direction.
I have been told that "everythng is possible" with Crystal reports if only you can think of how to do it.
Many thanks for taking the trouble to read this, please let me know if I have nmissed anything.
John