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 -> Java

 Custom Code

Print topic Send  topic

Author Message
Ans

Posts: 53
Posted: 06/01/2006, 7:59 PM

I am trying to write a custom code for an event. The system is jsp on MS SQL Server 2000.

JDBCConnection conn = JDBCConnectionFactory.getJDBCConnection("spcDB");  
long week = Utils.convertToLong(e.getRecord().getControl("week").getValue()).longValue();  
long yr = Utils.convertToLong(e.getRecord().getControl("year").getValue()).longValue();  
long ownID = Utils.convertToLong(e.getRecord().getControl("ownerID").getValue()).longValue();  
long target = Utils.convertToLong(e.getRecord().getControl("target").getValue()).longValue();  
  
  String sql = "EXEC getWkOwn "+                   
    conn.toSql(String.valueOf(yr),JDBCConnection.INTEGER)+  
    "," + conn.toSql(String.valueOf(week),JDBCConnection.INTEGER)+  
    "," + conn.toSql(String.valueOf(ownID),JDBCConnection.INTEGER)+  
	"," + conn.toSql(String.valueOf(target),JDBCConnection.FLOAT);  
  conn.executeUpdate(sql);  
  e.getCommand().setSql(sql);  
  
  conn.closeConnection();


The problem is the target value does not get executed in decimal format, but integer. I have set the format of the input textbox to 'FLOAT'.

Does 'JDBCConnection.FLOAT' exists?
View profile  Send private message
jres
Posted: 06/01/2006, 11:37 PM

you can check it during compilation
if code is compiled - it exists. :-)
Ans

Posts: 53
Posted: 06/01/2006, 11:43 PM

Quote jres:
you can check it during compilation
if code is compiled - it exists. :-)

it compiles...but it still does not register the value I want as a decimal. =(
View profile  Send private message
jres
Posted: 06/01/2006, 11:51 PM

I think you can try

double target = Utils.convertToDouble(e.getRecord().getControl("target").getValue()).longValue();
jres
Posted: 06/02/2006, 12:07 AM

hmm... better to use

double target = Utils.convertToDouble(e.getRecord().getControl("target").getValue()).doubleValue();
Ans

Posts: 53
Posted: 06/02/2006, 1:39 AM

Initial testing seems to work fine!

THANKS!!!!!
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.