0
votes

I am having an issue where I have similar hyphenated values 1304-4(text) and 1306 (number) The main issue I am trying to overcome, is when I export my SSRS report (.rdl) to excel, I get an error in excel, where it shows numbers are formatted as text. I seek to avoid this, and am open to any solutions to do so. I have searched vigorously and not found a solution that works. I have noticed that I can multiply the numerical values 1306*1.0000 and that would fix the issue, if not for the text values 1304-4*1.000 = null in report. Is there any way to accomplish this? I can cast my dataset as any other type of values, however SSRS only wants one kind of value in a field, as far as I am aware. Any thoughts or help would be appreciated.

1
Can you post some example data as text? - aduguid
Excel will mot treat numbers as text as long as you don't make them text in the report. Your "numbers" seem to come from a text-column in the report, so you cant expect Excel to treat some of the values differently. - Wolfgang Kais
The data below was copied from the Excel that SSRS produced. The values are set as VARCHAR on the table I am pulling them from. I believe SSRS formats everything to text based on a field only being able to have one data type. ITEM 1004-2 1005-3 1005-4 1010000 1010015 1010060 - Thomas

1 Answers

1
votes

You can try this expression

 =IIF(IsNumeric(Fields!<Your Field Name>.Value),Val(Fields!<Your Field Name>.Value),cstr(Fields!<Your Field Name>.Value))