Forum Discussion
I assumed it could be range driven, but in the example above, I don't ever come close to falling outside this range?
Hi, did you try converting your decimal to a string and logging this in the error log to see what might be the issue here?
- CAIGuySeanF2 years agoContributor
excuse the ignorance on my part, but not sure how to do that?
- Henning2 years agoValued Contributor II
Hi, no problem at all!
You will find the corresponding snippet when looking for "error":
You need to convert your final number to a string simply by adding a ".toString", e.g.:
Dim dDec As Decimal = 1
Dim sDec as string = dDec.ToStringThen you can log this as follows:
BRApi.ErrorLog.LogMessage(si, "My string value: " & sDec)
You then need to run the calculation (by opening your report) and then check the error log for the result. Likely you will see a number such as 0.000000000000000000000000000000000000000000000000000000000000000000000001 which will then tell you graphically (and as others said in their posts) why the system cannot handle this as the result likely falls out of the decimal range.
Please note that you should not open your standard report, but create a test report that contains only a single cell! And this single cell should be the one returning your error. This is because otherwise you would write the result of each cell into the error log. That is not advisable as (1) it is a slow process and might take a while in particular for large reports as the snippet I showed you uses a BRApi and (2) you will otherwise see many numbers in the error log and you may not be able to locate the one causing the error easily. Also, do that in a test environment where only you are working on. If that log is accidentally triggered by many other users at the same time, performance will suffer and the log will be flooded.
Very important: Deactivate / delete the error log function after you used it!
- CAIGuySeanF2 years agoContributor
Thanks for the thorough explanation and detail. I do see a long number, but can't seem to figure out how to round or convert it to a double. I tried Daniel's idea below, but to no avail. Any ideas?
Related Content
- 12 months ago
- 8 months ago
- 3 years ago
- 6 months ago