Normal Topic Report: Sum + Programming Pulling Old Field Data (Read 669 times)
actiontech
Full Member
***
Offline



Posts: 173
Joined: Apr 10th, 2016
Report: Sum + Programming Pulling Old Field Data
Nov 7th, 2016 at 12:18am
Print Post Print Post  
Hello, I'm having a problem with a report. The report takes an unbound value (Total_Owed_Correct) in the body of the report, that has programming assigned to it "On Print," that has a conditional statement. So, if the Boolean field is "No" then value is value, "Yes" then value is 0.

Code
Select All
var vTotal as Double


If(Paid_Correct = No) then
{

	vTotal = Amount

}
else
{

	vTotal = 0

}

Total_Owed_Correct = @SUM(vTotal)
 



I then have a "Sum" Summary Calculation in one of the Group Footers, of that Unbound Value (Total Owed Correct).

Everything seems to work correctly, however when I run the report from the actual database, the data it's pulling from the field attached to the LE "Amount" is not always the current data. It's pulling data that was entered previously. For example, in one current record, "Amount" = $90. However, in the report it's showing for that same record, "Amount" = $164. Which is what it was about 4.5 months ago.
  
Back to top
 
IP Logged
 
actiontech
Full Member
***
Offline



Posts: 173
Joined: Apr 10th, 2016
Re: Report: Sum + Programming Pulling Old Field Data
Reply #1 - Nov 7th, 2016 at 12:23am
Print Post Print Post  
Another interesting note, is that when you click to create a new Value in the Report Designer, the choices it gives to "Bind Element To" sometimes are LE's that no longer exists, and the list sometimes is not up to date with the current LE's  and/or their Names.
  
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2483
Joined: Aug 20th, 2003
Re: Report: Sum + Programming Pulling Old Field Data
Reply #2 - Nov 7th, 2016 at 4:35pm
Print Post Print Post  
actiontech wrote on Nov 7th, 2016 at 12:18am:
Everything seems to work correctly, however when I run the report from the actual database, the data it's pulling from the field attached to the LE "Amount" is not always the current data. It's pulling data that was entered previously. For example, in one current record, "Amount" = $90. However, in the report it's showing for that same record, "Amount" = $164. Which is what it was about 4.5 months ago.


Check what field the Amount element is bound to in the report and what field the Amount element on your form is bound to. It is likely they are bound to different elements.

-Ray

-Edit- As a side note: There is no need to use @Sum() in the programming that you have.
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2483
Joined: Aug 20th, 2003
Re: Report: Sum + Programming Pulling Old Field Data
Reply #3 - Nov 7th, 2016 at 4:38pm
Print Post Print Post  
actiontech wrote on Nov 7th, 2016 at 12:23am:
Another interesting note, is that when you click to create a new Value in the Report Designer, the choices it gives to "Bind Element To" sometimes are LE's that no longer exists, and the list sometimes is not up to date with the current LE's  and/or their Names.


When you are adding a new Value Box to a report, the options listed in the "Bind Element To" dropdown is the list of Field names in the Database which may differ from the Element names.

If you are adding a Summary Calculation element to a report, the options listed in the "Bind Element To" dropdown is the list of Element names on THIS report that can have that type of calculation performed on them.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged