November 16, 2009 at 2:50 am
Hi All,
Can someone assist me as how can I sum reportitems values.
my expression is below, but it display a binary code like 1.001.001.00
=reportitems!YTDKRA_Closed_WITH_SLA.Value+
reportitems!YTDKRA_Closed_ofAssignned.Value+
reportitems!YTDKRA_Perc_Queries_Red.Value+
reportitems!YTDKRA_Perc_Queries_Amber.Value+
reportitems!YTDKRA_Per_Internal_Quality.Value+
reportitems!YTDKRA_Per_External_Quality.Value
November 17, 2009 at 9:08 am
What are the values in the individual fields?
It looks like it's concatenating three string values of "1.00", "1.00" and "1.00"
You may need to convert to a numeric type before doing the addition using CDbl or CDec like this:
CDbl(reportitems!TextBox1.Value) + CDbl(reportitems!TextBox2.Value) + ...
See here for details of the VB conversion functions.
November 17, 2009 at 9:16 am
Or you could add the values by referencing the original columns from the report dataset, or do the calculation in your query or stored proc. Either of which is probably more correct as the fields in the report itself may be formatted with for example a fixed number of decimal places which in certain cases could give you an incorrect sum.
November 18, 2009 at 12:06 am
Thank, It worked perfectly
All the best
November 18, 2009 at 1:45 am
Good, which solution did you use? Just for the benfit of others.
November 18, 2009 at 1:57 am
I have learned to convert the field values data types. I was wrong when I thought you can simple convert it from the property window format portion.
November 18, 2009 at 2:19 am
Removed: my assumption was incorrect! Talking **** again 😀
I had assumed that formatting a field would affect any arithmetic done on that field as a result of the formatting. After trying it out I found that this is not the case, which makes sense after thinking about it some more.
Serves me right for jumping in before I'd had enough coffee
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply