CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> Archive -> GotoCode Archive

 Before Show - jsp

Print topic Send  topic

Author Message
Espen Dahl
Posted: 04/17/2003, 1:35 PM

I am trying to enter before show code to multiply two values from different controls in the same grid. According to the documentation this can be done like this: e.getRecord().getControl("Total").setValue(e.getRecord().getControl("Quantity").getValue().longValue() * e.getRecord().getControl("Price").getValue().doubleValue() );

But i keep getting "Method longValue() not found in class java.lang.Object." and "Method doubleValue() not found in class java.lang.Object."

Any ideas?

bb
Posted: 04/19/2003, 11:24 AM

bbb
h
Posted: 04/19/2003, 11:26 AM

h
Dandavat
Posted: 04/21/2003, 1:40 AM

Espen,

getValue() method returns Object, so you need to cast to Double and Long accordingly.

long q = ((Long)e.getRecord().getControl("Quantity").getValue()).longValue();
double p = ((Double).getRecord().getControl("Price").getValue()).doubleValue();
e.getRecord().getControl("Total").setValue(q*p);

Pranams,
Dandavat.

   


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

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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