on 02-22-2013 7:44 PM
Crystal Reports 2011 and Crystal Report for Visual Studio 2010, service pack 4
I have a very simple table where each row represents a measurement M with a timestamp T, a value V, and the number of decimals to display D
For example, my table has:
M | T | V | D |
---|---|---|---|
M1 | T1 | V1 | 1 |
M1 | T2 | V2 | 1 |
M2 | T1 | V3 | 3 |
M2 | T2 | V4 | 3 |
My rows are the measurements, grouped by M, my colums are the timestamp T, my summarized field is Max of V1 so my crosstab looks like
Measurement\Timestamp | T1 | T2 |
M1 | V1.nn | V2.nn |
M2 | V3.nn | V4.nn |
What I want is for V1 and V2 to be displayed as a number with one place past the decimal showing, e.g. V1.n and V2.n and for V3 and V4 I want three places after the decimal to be displayed, e.g. V3.nnn and V4.nnn:
Measurement\Timestamp | T1 | T2 |
M1 | V1.n | V2.n |
M2 | V3.nnn | V4.nnn |
I know I can do this with a formula on the V's, but the problem with that is when I export to Excel the cells contain strings. I want them to be numbers.
Is there any way I can tell the cross-tab for format these things by row? I used the Format Field, Customized Number, then created a formula for the Decimals places, but it does not change based on the row.
-nld
Hi,
What you are doing should work but it would depend on how your formula is finding the row.
For Crosstabs, you have to use the GridRowColumnValue function to find the correct row.
So your formatting formula would look something like:
Select Case GridRowColumnValue("M")
"M1" : ...
"M2" : ...
Default: ...;
Or do an If statement like:
If GridRowColumnValue("M") = "M1" Then
...
Else If GridRowColumnValue("M") = "M2 Then
...;
Hope this helps,
Brian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.