I have a matrix with dynamic parameters operating the rows, columns and data field of the matrix. The 4th one will apply a chosen aggregate function to the data field. The values of the data parameter are called
LengthOfStay
and
FinalCost
Depending on which of the two values the user selects when running the report, I want the report to format the number type according to which value has been selected. LengthOfStay should appear on the report as integers, preferably with a thousand separator. FinalCost should appear on the report as currency (GBP in this case.)
I've tried doing this in the Number Format property of the data field textbox;
=SWITCH
(Parameters!prmDataField.Value=Fields!Length_of_Stay.Value,"G0"
,Parameters!prmDataField.Value=Fields!Spell_Final_Cost.Value,"C0")
But when the report runs the numbers in it are not formatted and the following warning is given below;
Warning 1 [rsRuntimeErrorInExpression] The Format expression for the textrun ‘Textbox17.Paragraphs[0].TextRuns[0]’ contains an error: Input string was not in a correct format'
I have absolutely no idea how to syntax this and if it's even possible. I'm still getting used to expressions but applying them to formatting where number types are concerned seems to be even more complex!
Thanks for anyone taking the time to understand and help :)