0

I tried to add a new line to a textbox to make the values appears like this:- enter image description here

I wrote the following expression:-

=FormatNumber(val(COUNTDISTINCT(Fields!YearMonth.Value)) ,Parameters!DecimalScale.Value,true,nothing,nothing) + VbCrLf + FormatNumber(Val(Sum(Fields!Amount.Value)),Parameters!DecimalScale.Value,true,nothing,nothing).ToString

but it returns the first value only not all the value and I also used

& vbcrlf & 

and the same happens

enter image description here

Bishoy Ezzat
  • 99
  • 10
  • When I tried using pluses (`+ VbCrLf +`), it **added** the two numbers together but when I used `& vbcrlf &` I did get **separate** lines. Also, you **shouldn't** need the **VAL** in there since **COUNT** would be a number. – Hannover Fist Sep 28 '16 at 17:33

1 Answers1

1

I just tested your expression on my machine and it works fine. I tested this using the following query as the dataset:

SELECT 'Emp 1' "Employee",201601 "YearMonth", 1000 "Amount" UNION ALL
SELECT 'Emp 1',201602, 1000 UNION ALL
SELECT 'Emp 1',201603, 1000 UNION ALL
SELECT 'Emp 2',201601, 1000 UNION ALL
SELECT 'Emp 2',201602, 1000 UNION ALL
SELECT 'Emp 2',201603, 1000 UNION ALL
SELECT 'Emp 3',201601, 1000 UNION ALL
SELECT 'Emp 3',201602, 1000 UNION ALL
SELECT 'Emp 3',201603, 1000 UNION ALL
SELECT 'Emp 4',201601, 10 UNION ALL
SELECT 'Emp 4',201602, 1 UNION ALL
SELECT 'Emp 4',201603, 2

You need to ensure that the text box property is set to CanGrow = True. To do this, select the cell, under properties navigate to CanGrow, and set to True.

If it has been manually sized and CanGrow has been set to false, the data is there, just hidden as it cannot fit into the cell

Louie
  • 528
  • 3
  • 8