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)
using exponent via javascript
digiSeryog
hi i have a function in an external js file
function qm(value)
{
if(value < 1000)
return format("# m?", value);
else
return format("#,## km?", value/10);
}
and when i use the function in a dynamic text the label have no ? at the end.
but it works via expression builder when im type '?' or create a function in the initilize event
function func()
{
return "?";
}
does anybody know where the problem is ?
Find more posts tagged with
Comments
digiSeryog
hi i have a function in an external js file
function qm(value)
{
if(value < 1000)
return format("# m?", value);
else
return format("#,## km?", value/10);
}
and when i use the function in a dynamic text the label have no ? at the end.
but it works via expression builder when im type '?' or create a function in the initilize event
function func()
{
return "?";
}
does anybody know where the problem is ?
mwilliams
Try replacing your ? with the html code, '& #178;', in your external js file.
There should be no space in the above code, but if I don't leave it, it changes to the ²
digiSeryog
thx it works!
digiSeryog
ok its only working with dynamic labels
in an dataset i get : & #178; without space
Edit Data Binding:
Data Type: String
Expression: qm(dataSetRow["summe"])
same function works with dynamic labels hmm
mwilliams
Once you put the field in the dataSet, that now has the code in it, into a text box in the report, it turns into a ² right? If so, and it's just not working from a data binding, you could simply use a text box in place of the data element. Or is there a reason for not doing this?
digiSeryog
the value is coming from a database so i need it
i have a workaround but its quick and dirty
qm(dataSetRow["summe"])+'?'
mwilliams
Maybe I'm not understanding. I thought that the value was coming as the code in your dataSet. I just meant that when you drag your dataSet into your layout, it uses a data element. If you switched to a text element, would the code turn into the exponent. If you've got a workaround, then it's no big deal. If you'd like to find another way around it, just reproduce the issue with a sample report using the sample database and attach it in here and I'll try to help!
digiSeryog
its easy i pass the dataset as an value to a external js function and modify the value there e.g
i get an integer from a database and pass it to the function
qm(dataSetRow["row"]) // this is in the dataset label
function qm(dataset)
{
return dataset+"km?";
}
as a return value i get
200km
and when i use a dynamic label e.g
qm(200) // this is in the dynamic label
i get 200km?