Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: data changes if location of field is changed Post Reply Post New Topic
Author Message
mabrown
Newbie
Newbie


Joined: 08 Jun 2007
Online Status: Offline
Posts: 27
Quote mabrown Replybullet Topic: data changes if location of field is changed
     Posted: 16 Apr 2014 at 4:56am
I am not even sure what information you need to help with this. 
We have a simple Crystal XI report with 2 group headers defined. And just by chance the creator placed the same field in both the header and footer of group 2.  The field reports different data depending on the location.  In the group2 header it reports the name of an Iowa county Linn and in the group2 footer it reports the name of a Michigan county Missaukee.
Group 1 is tax state
Group 2 is the tax county
What do we look for????

select
shipto_master.*, ISNULL((select top 1 cz.county_name from city_zip cz where cz.state = shipto_master.ship_state and cz.county_code = shipto_master.tax_county), '') as 'tax_county_name',
(select sum(quantity * taxable_amt) from shipto_detail where shipto_detail.order_id = shipto_master.order_id and shipto_detail.shipto_num = shipto_master.shipto_num and shipto_detail.status in ('S','R'))
from shipto_master
where close_flag = 'Y'
and tax_amt <> 0

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 16 Apr 2014 at 5:49am
when placing a dataset field into a group header it displays the value from the first row of data in that group.
when placing a dataset field into a group footer it displays the value from the last row of data in that group.
IP IP Logged
mabrown
Newbie
Newbie


Joined: 08 Jun 2007
Online Status: Offline
Posts: 27
Quote mabrown Replybullet Posted: 16 Apr 2014 at 6:24am
Ok, that makes sense except Group 1 defines the state and group 2 the county within the state so there is only 1 data set for each county number within the state.    The footer is reporting a county from another state.
What is even more puzzeling is we modified an existing report by supressing sections and moving fields around.  We did not add any fields or calculations.  The original report works correctly.
thank you
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 16 Apr 2014 at 6:35am
unsuppress the details section and verify you only have one detail record in the group2. Suppressed records are still part of the group.
Also if you are conditionally suppressing sections you may actually be viewing a group header and footer 2 inside group 1 from a different group results.
Meaning:
State 1 header - (shown)
   County1 - gheader (shown)
         details (suppressed)
   Counyt1 gfooter (suppressed)
   County2 - gheader (suppressed)
         details (suppressed)
   County2 gfooter (suppressed)
   County3 - gheader (suppressed)
         details (suppressed)
   Count3 gfooter (shown)
State 2 Groupheader (shown)
....


Edited by DBlank - 16 Apr 2014 at 6:35am
IP IP Logged
mabrown
Newbie
Newbie


Joined: 08 Jun 2007
Online Status: Offline
Posts: 27
Quote mabrown Replybullet Posted: 16 Apr 2014 at 8:48am
We only had the groups like you have in the green.
We will never know.  We just started from the original report and modified it again and it works correctly.
Thank you for your help.
IP IP Logged
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