Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Javascript function() issue inside BIRT
vidu
Hi
I have a problem using function inside BIRT
eg .. I try to do something like this
importPackage( Packages.java.io );
out = new PrintWriter( new FileWriter( "c:/BIRT/scripts/outputs.txt", true ) );
var inpt = params["testparam"].value;
if ( inpt > 2 ){
var input = params["testparam"].value;
function chequeAmount(input) {
var rupees = Math.floor(input);
var paise = Math.round((input*100 - rupees*100));
var thousands = (rupees - rupees % 1000) / 1000;
out.println("rupees" + rupees);
var lakhs = 0;
var crores = 0;
rupees -= thousands * 1000;
if(thousands > 99) {
lakhs = Math.floor(thousands / 100) ;
thousands = thousands - lakhs*100;
}
if(lakhs > 99) {
crores = Math.floor(lakhs / 100) ;
lakhs = lakhs - crores*100;
}
if(crores > 99) {
//alert ("Invalid amount");
return '';
}
//out.println("The Input is" +inpt);
}
}
else{
params["testparam"].value ;
out.println(" ELSE block" +inpt);
}
out.close();
this does not seem to work , I mean the
function chequeAmount(input) never works
i have tried to print
out.println("rupees" + rupees); that is inside the function
i'm not sure what i'm doing wrong here ?
Find more posts tagged with
Comments
mwilliams
Hi vidu,
So, the writing to the output file works fine, just not the custom function inside BIRT? Are you getting any errors?