Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: another way of creating a report Post Reply Post New Topic
Author Message
Nardagus
Newbie
Newbie


Joined: 10 Feb 2009
Location: Poland
Online Status: Offline
Posts: 3
Quote Nardagus Replybullet Topic: another way of creating a report
    Posted: 10 Feb 2009 at 4:55am
Hello All,
 
Im new to CR and about SQL Im no expert either but I manage  :)
Anyway I have a question.  I have the following report in Excel:
 
                            | product brand 1 | prod. brand 2 | prod. brand 3 | total
sales target         | {value}              | {value}          | {value}          | total
currect sale          | {value}              | {value}          | {value}          | total
% sale/target      | {value}              | {value}          | {value}          | total
week of the year |
Week 1                |sum{sales_val}|sum{sal_val}    |sum{sal_val}  |total
Week 2                |sum{sales_val}|sum{sal_val}    |sum{sal_val}  |total
...
 
What does this report do?
1) Devides sales value of orders of a representative into weeks of the year
2) Sale in weeks is also devided into products brand (based on article category.
3) current sale is a sum of sales value in brands
4) % is calculated current sale to target
5) Target is selected from a database
 
I have managed to do such report in CR. My problem is that it takes time to generate it. I based this report on couple of subreports which are linked to main report with name of representative  and week of the year.
Ive noticed that what slows this report is a division on weeks. (well seems report has to do over 250 queries and it depends on machine speed).
None of options like: use indexes or server for speed, perform grouping on server didnt help.
 
I was wondering if there is another way to do this report without need of creating views.
Thank you for any help
 
Regards
Rafal
 
IP IP Logged
despec99
Newbie
Newbie


Joined: 10 Feb 2009
Online Status: Offline
Posts: 22
Quote despec99 Replybullet Posted: 10 Feb 2009 at 5:50am
Do you mean, "without creating subreports"?

David
IP IP Logged
Nardagus
Newbie
Newbie


Joined: 10 Feb 2009
Location: Poland
Online Status: Offline
Posts: 3
Quote Nardagus Replybullet Posted: 10 Feb 2009 at 6:08am
Maybe there is a way to display the data I need with formulas only without using subreports or maybe it can be done with less subreports then I have now (5 of them).
Or maybe... I can do it without linking subreports with main report using formula field:
 
Datepart( "ww", CDtate({date_field}) -36161)
 
(Date field is an integer).
 
As I said earlier it's this link which causes report generates so long.
Still I need such output of values vs weeks:
 
               Prod. br 1     Prod. br. 2
Week 1    400Euro
Week 2    100Euro        200
 
Rafal


Edited by Nardagus - 10 Feb 2009 at 6:09am
IP IP Logged
despec99
Newbie
Newbie


Joined: 10 Feb 2009
Online Status: Offline
Posts: 22
Quote despec99 Replybullet Posted: 10 Feb 2009 at 6:12am
In CR, you can group by date and by a "sub part" of that date (day, week, year)...Maybe you can find a way to use CR groups to tackle your problem.  No doubt that it's the subreport slowling things down.  I try to avoid using them at all costs in my reports.

David
IP IP Logged
Handsome-Hal
Newbie
Newbie
Avatar

Joined: 06 Feb 2009
Location: United States
Online Status: Offline
Posts: 7
Quote Handsome-Hal Replybullet Posted: 10 Feb 2009 at 12:36pm
I know you said without creating views...but why not let the database do the heavy lifting for you?

That way, whether you have subreports or not, it will speed things up.

Hal
IP IP Logged
Nardagus
Newbie
Newbie


Joined: 10 Feb 2009
Location: Poland
Online Status: Offline
Posts: 3
Quote Nardagus Replybullet Posted: 12 Feb 2009 at 2:35am
Tx. I will try. :)
 
Regards
Rafal
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 12 Feb 2009 at 6:12am
if you want to speed up the report, you really want to reduce the hits to the database, and subreports really hit the database.  depending on how the report is grouped, say it is by sales rep.  If you have 5 sales reps, you will have 26 hits to the database.  If you can select all of the data that you need into 1 line of data (stored proc or view) then you can probably do away with the subreports.  The data may take a bit longer to process, but I am willing to bet that 1 hit to the database vs 250 will be faster.
 
I'll be honest, I don't know how complex my reports are, but I almost never use subreports anymore, I already have the data (from a stored proc) so why hit the database again?
 
Hope this helps.
IP IP Logged
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.031 seconds.