Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: variables don't seem to be working Post Reply Post New Topic
Page  of 3 Next >>
Author Message
bwsanders
Senior Member
Senior Member


Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
Quote bwsanders Replybullet Topic: variables don't seem to be working
    Posted: 30 Jul 2013 at 8:53am
so, in my report i'm initializing variables in the header, setting the variables in the output (supressed) and then calling the variable in the footer as to get one single line with all of my data for each employee.

I've got several formulas that look at one field that has many results and it's shows a true or false depending upon the data in the field. when i run the report it's returning all false however if i look at the raw data in sql i can see that several should be true.

i'm not quite sure what's happening.

any thoughts?


IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 30 Jul 2013 at 10:01am
unsuppress them in the detail row and see what is happening there.
IP IP Logged
bwsanders
Senior Member
Senior Member


Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
Quote bwsanders Replybullet Posted: 30 Jul 2013 at 10:04am
i tried that and then it just shows me several records for the first field only (emp id) and then shows me the footer. it's weird i'm not sure what is bunking out on this report. 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 30 Jul 2013 at 10:17am

but did you get the correct T/F value per record (assuming you are updating the value per row)?

 Can you show your formula?
IP IP Logged
bwsanders
Senior Member
Senior Member


Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
Quote bwsanders Replybullet Posted: 30 Jul 2013 at 10:21am
here is the formula

If {ETax.tcode} In ["MED", "SS"]
    Then "Y"
Else
    If NOT ({ETax.tcode} In ["MED", "SS"])
        Then "N"

super simple

in the footer it shows N,N,N,N,N

when in fact it should be N,Y,N,N,Y

if i look at each individual line it would look like

N N N Y N
Y N N N N
N Y N N N
N Y N N N

i thought maybe the variable was resetting too soon so i tried it without it and still got the same results.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 30 Jul 2013 at 10:31am
where are you concantenating it?
IP IP Logged
bwsanders
Senior Member
Senior Member


Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
Quote bwsanders Replybullet Posted: 30 Jul 2013 at 10:35am
in the footer i'm calling the variables like

var1 + "," + var2 "," and so on
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 30 Jul 2013 at 10:45am
you can just use one formula to run through all the rows.
You need one formual in GH to set the variable to blank
one to run through the data (details
one to display (GF)
 
 
//group header
shared stringvar x;
x : = ""
 
//detail
shared stringvar x;
x : = x + (If {ETax.tcode} In ["MED", "SS"] Then "Y, " else "N, ");
 
//footer
shared stringvar x;
x := left(x,len(x)-2)


Edited by DBlank - 30 Jul 2013 at 11:39am
IP IP Logged
bwsanders
Senior Member
Senior Member


Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
Quote bwsanders Replybullet Posted: 30 Jul 2013 at 11:27am
Thanks DBlank! for some reason still no luck. I'll do some more digging tomorrow. 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 30 Jul 2013 at 11:39am

to trouble shoot

unsuppress the detail section
place the detail formula next to the tcode field and watch how they interact to see if you can find a pattern
IP IP Logged
Page  of 3 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.031 seconds.