CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Divison By Zero Error

Print topic Send  topic

Author Message
ckroon

Posts: 869
Posted: 03/22/2008, 11:01 PM

Hi All

I am developing a transcript page for HS students to view their GPA.s and am running into a frustrating issue.

On a grid I display their courses and GPA scores.

I have a hidden field: tgpa which totals the gpa scores from all the courses in the grid
A hidden field: numc which retrieves the number of records in the grid.
And the gpa1 field which is supposed to divided tgpa by numc and come up with their gpa, but I get a 'Division by Zero' error.

Label 'gpa1': Before Show of the label( This is where the error comes from)
$Component->SetValue($ntran->tgpa->GetValue()/ $ntran->numc->GetValue() );

Hidden field 'tgpa': Before Show Row
 $ntran->tgpa->SetValue($ntran->tgpa->GetValue() + $ntran->gpa->GetValue() );

Hidden Field 'Numc' : a 'retrieve number of records' action which is in the Before Show event

When I switch the hidden fields to labels, all the numbers for numc and tgpa display properly.

TIA

_________________
Walter Kempees...you are dearly missed.
View profile  Send private message
ckroon

Posts: 869
Posted: 03/23/2008, 9:00 AM

I figured it out :)

The action "Retrieve number of records" put it on hte Before Show event of the label. I simply moved it to the before show row event of the grid and everything is fine.

_________________
Walter Kempees...you are dearly missed.
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.