Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Shared Variable Problem Post Reply Post New Topic
<< Prev Page  of 2
Author Message
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 29 Nov 2019 at 8:30am
are you just wanting a 'final number' or is this incrementally showing the overall total from group to group?
If it is incremental you would have to create a MR data set that includes all values so you can create the correct groups.
If it is a final number you can just run a one time sr in a rf that gives your total across "all the groups" which are superfluous so can be omitted and pass that sum back and use it.

Edited by DBlank - 29 Nov 2019 at 8:31am
IP IP Logged
sfullergs
Newbie
Newbie


Joined: 06 Nov 2019
Online Status: Offline
Posts: 13
Quote sfullergs Replybullet Posted: 29 Nov 2019 at 8:43am
This may illustrate it a little better. It's not a number issue per-se. I have these grouped by tbnatur.desc. Some of these natures are on the subreport when I run it independently, but don't come over to the main report because those natures don't exist on the main report. Basically, I need to blend these two together to where if the main report doesn't have a call nature but the subreport does, the nature and count for that show up.

Screenshot of main report result:
https://www.dropbox.com/s/2fw4kyu1r9s6zfs/cfs.PNG?dl=0

Screen shot of subreport result:
https://www.dropbox.com/s/srblfrg1tg79jby/sr.png?dl=0

In these screenshots, the subreport is the column of numbers on the left and the main report is the column of numbers on the right. There are multiple instances where this takes place, I just used the one on the last line because it is easiest to show.


Edited by sfullergs - 29 Nov 2019 at 8:46am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 29 Nov 2019 at 8:52am
Why are you using a subreport and not just one dataset? What is it about the process that requires you to split it out? Do you have the ability/rights to create a command or stored proc (or similar) instead of the sub report process? The problem you are describing will be hard to resolve keeping the Main and subreport model unless you can alter your selection process in the MR to somehow include all possible groups that can occur in the SR. It might be easier to just think about one data set instead.
IP IP Logged
sfullergs
Newbie
Newbie


Joined: 06 Nov 2019
Online Status: Offline
Posts: 13
Quote sfullergs Replybullet Posted: 29 Nov 2019 at 8:55am
Originally posted by DBlank

Why are you using a subreport and not just one dataset? What is it about the process that requires you to split it out? Do you have the ability/rights to create a command or stored proc (or similar) instead of the sub report process? The problem you are describing will be hard to resolve keeping the Main and subreport model unless you can alter your selection process in the MR to somehow include all possible groups that can occur in the SR. It might be easier to just think about one data set instead.

It is comparing two different years of data; 2018 (left column) and 2019 (right column), or whatever two years you select. I have the date selections tied to parameters. I have full rights but have absolutely no idea how to work with stored processes, etc. Even when forcing the main report to include any call nature that could exist, it still will not display it on the main report (2019) if it doesn't exist for that year.

Edited by sfullergs - 29 Nov 2019 at 8:57am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 29 Nov 2019 at 9:13am
You can still have one set of data for the two years and use Running Totals super easy to create 'two columns'
Select criteria shows two full years
Group on the product
Create two running totals, one per year
in the RT type set it to use a condition and use the year in that. You can also use a formula to make it conditional so it adjusts based on the entry params or some sort of calendar condition if this is a pre-set condition of years against the current calendar date.

Way simpler and way less overhead. Sub reports can just kill the performance.
Not sure what you are counting or how exactly but can help with RT set up if you post that and need assist.
IP IP Logged
sfullergs
Newbie
Newbie


Joined: 06 Nov 2019
Online Status: Offline
Posts: 13
Quote sfullergs Replybullet Posted: 29 Nov 2019 at 9:34am
Originally posted by DBlank

You can still have one set of data for the two years and use Running Totals super easy to create 'two columns'
Select criteria shows two full years
Group on the product
Create two running totals, one per year
in the RT type set it to use a condition and use the year in that. You can also use a formula to make it conditional so it adjusts based on the entry params or some sort of calendar condition if this is a pre-set condition of years against the current calendar date.

Way simpler and way less overhead. Sub reports can just kill the performance.
Not sure what you are counting or how exactly but can help with RT set up if you post that and need assist.

The problem is, I'm not just trying to get a final total. I want to display the count of each call type for each year that is selected. Basically a side by side comparison then at the end I would total everything.
IP IP Logged
sfullergs
Newbie
Newbie


Joined: 06 Nov 2019
Online Status: Offline
Posts: 13
Quote sfullergs Replybullet Posted: 29 Nov 2019 at 10:15am
Originally posted by DBlank

You can still have one set of data for the two years and use Running Totals super easy to create 'two columns'
Select criteria shows two full years
Group on the product
Create two running totals, one per year
in the RT type set it to use a condition and use the year in that. You can also use a formula to make it conditional so it adjusts based on the entry params or some sort of calendar condition if this is a pre-set condition of years against the current calendar date.

Way simpler and way less overhead. Sub reports can just kill the performance.
Not sure what you are counting or how exactly but can help with RT set up if you post that and need assist.

Going by your suggestion, it seems like I can easily get the 2 years worth of data on the same report using parameters. It's just a matter of getting the numbers into two separate columns and having one column only numbers for parameters {?CBeginning Date} to {?CEnding Date} and the other for parameters {?Begin Date} and {?End Date}. I tried a running total where the field to summarize was tbnatur.desc and wrote and evaluation formula where cdcall.whenocc1 was in {CBeginning Date} to {?CEnding Date} and it reset on change of group tbnatur.desc but I get a 1 if something exists and 0 if something does not. I have the running totals to get the grand totals figured out already, I just can't figure out how to get only counts specific to {?CBeginning Date} to {?CEnding Date} to display a correct count.

Edited by sfullergs - 30 Nov 2019 at 1:47am
IP IP Logged
sfullergs
Newbie
Newbie


Joined: 06 Nov 2019
Online Status: Offline
Posts: 13
Quote sfullergs Replybullet Posted: 30 Nov 2019 at 3:31am
OK, I got all of this figured out and working correctly using running totals, formulas, and summaries. Thank you very much for getting me on the right (and better) track to knock this out.

IP IP Logged
<< Prev Page  of 2
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.