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 3My 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.nnWhat 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:
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
Add a comment