Home
Analytics
Help with formatting a Float DB field, losing precision.
cjm13905
<p>BIRT version 3.7.1</p><p> </p><p>I have a database field regularhrs defined as float(126)</p><p> </p><p>My output column is defined as type: Float</p><p> </p><p>The Edit Data Binding type is : Float</p><p> </p><p>I cannot get this field to display correctly.</p><p> </p><p>I am losing precision.</p><p>DB values of .25 are coming out at 0</p><p> </p><p>I have tried various values for the output column, Edit Binding Type, and the fields</p><p>properties Format Number (Format, Decimal Places, and Rounding Mode) </p><p> </p><p>Anyone know what combination of the </p><p> </p><p>Output column, binding type, and Properties (format number) will work ? </p><p> </p><p>Also, how can I force a decimal field to print the two positions to the right of the decimal, </p><p>even if the numbers are .00 ?</p><p> </p><p>Thanks much</p><p> </p><p> </p><p> </p>
Find more posts tagged with
Comments
kclark
<p>When you preview the data in your data set is it returning correctly? If you're having a problem with how it's being displayed in some report item you can use toFixed()</p><pre class="_prettyXprint">var currentValue = parseFloar(this.getValue);this.value = currentValue.toFixed(2);</pre>
cjm13905
<blockquote class="ipsBlockquote" data-author="kclark" data-cid="119923" data-time="1378321419"><div><p> </p><p>When you preview the data in your data set is it returning correctly? If you're having a problem with how it's being displayed in some report item you can use toFixed()</p><pre class="_prettyXprint">var currentValue = parseFloar(this.getValue);this.value = currentValue.toFixed(2);</pre></div></blockquote><p>I'm a newbie, with limited training to date. I have the BIRT A Field Guide manual on-line but it is for BIRT 2.6 and we are at 3.7</p><p>I don't see how to preview the data. </p><p> </p><p>I've opened up the Data Source.</p><p>Clicked on Preview Results and no records.</p><p>I added a filter but still no records</p><p> </p><p>I know it is a lot to ask, but if you have any ideas,</p><p>or can guide me how to use the preview in 3.7 I'd be in your debt.</p><p>And if you can point me to better online documentation for 3.7 that would be great.</p><p> </p><p>I should mention, I use BIRT to report off of Maximo application. In BIRT 3.7.1 the data source has a </p><p>"Select Data Source" option, which is set to maximoDataSource. </p><p>The actual sql is in the open/fetch script for the Dataset.</p>
BRM
<p>right click on the data set (not the data source) and select edit (top choice). In the dialog that results which should have your query in it, preview results should be the last entry on the left panel.</p>
cjm13905
<blockquote class="ipsBlockquote" data-author="BRM" data-cid="119930" data-time="1378324698"><div><p>right click on the data set (not the data source) and select edit (top choice). In the dialog that results which should have your query in it, preview results should be the last entry on the left panel.</p></div></blockquote><p>Yes, I've done that but it is selecting 0 records.</p><p>There is a parameter into the report called wonum, a valid value being 101010.</p><p> </p><p>I've tried the preview as you stated with 0 records.</p><p>I've added a parm (wonum default value = 101010 ) and still 0 records.</p><p>I honestly don't see how there is a connection between the data set and the actual Oracle table until I create sql in the </p><p>open and fetch script for the dataset, I don't know how this preview can work without the connection to the sql in the open and fetch scripts.</p><p>Again, I am on BIRT 3.7.1. I think the dataset creation has changed from prev releases.</p>
BRM
<p>If the preview is selecting no records then how are you getting data in the report when you run it? Preview should select the same data as the report when run with the default parameters. Your original post suggests that you get some sort of output.</p>
cjm13905
<blockquote class="ipsBlockquote" data-author="BRM" data-cid="119944" data-time="1378391576"><div><p>If the preview is selecting no records then how are you getting data in the report when you run it? Preview should select the same data as the report when run with the default parameters. Your original post suggests that you get some sort of output.</p></div></blockquote><p>I am new to BIRT, and have only seen version 3.7.1</p><p> </p><p>When I run the report I do get data.</p><p> </p><p>After trial and error, this is what I did.</p><p>I updated my sql in the open, for the dataset, and hardcoded all values that were being passed as parms.</p><p>I was then able to run the preview with data being displayed. </p>
BRM
<p>I'm glad you got it to work. Perhaps you didn't specify default values for your parameters. That will cause the behavior you describe.</p>