Link to home
Start Free TrialLog in
Avatar of rhservan
rhservanFlag for United States of America

asked on

How do I convert an alphanumeric field in SSRS and export to excel to avoid the number stored as text error?

I have a report with 12 columns. 11 columns export fine to excel.  However,  I have one of the SSRS columns that is an numeric & alphanumeric, aaa1111....etc..  When I export to excel and I open the file to view I have the green error mark in the cells of that column that are just numbers.

If I change to  the expression =CDbl(Fields!your_numerical_column.Value) on the field all of my numbers only are corrected but the alphanumeric have errors.   Please assist.

Avatar of HainKurt
HainKurt
Flag of Canada image

try wrapping it into " for that column

expression = '"' + ... + '"'
Avatar of rhservan

ASKER

Here is the expression that I placed on that field:

=""+Fields!TrailerNumber.Value+""

This worked only on the alphanumeric but not the numeric only.
try

=""""+Fields!TrailerNumber.Value+""""
or
="'"+Fields!TrailerNumber.Value+"'"


This worked to remove the errors in excel:
=""""+Fields!TrailerNumber.Value+""""
However, in both the report and excell it shows the double quote around the values.  Is there a way to hide them?
E.g. - "41244" or "JBHY3277"
Or perhaps another method.  I am testing the other expression now.
Second expression results:
This worked to remove the errors in excel:
="'"+Fields!TrailerNumber.Value+"'"
However, in both the report and excell it shows the double quote around the values.  Is there a way to hide them?
E.g. - '41244' or 'JBHY3277'

This seems to be pretty much the same issue with the single quotes.   Waiting for further advisement.
what is your query?
Is there a particular part of the query you need to view?
the part for "aaa1111"
Here is the query.
EESample.txt
which column is creating issue?
Trailernumber
also can you please post a sample excel file that shows the issue...
Excel in .png format User generated image
can you please post a small sample of that excel file
as an excel file, attachement I mean
Here you go.
EESamplexls.xls
ASKER CERTIFIED SOLUTION
Avatar of HainKurt
HainKurt
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
when you select a range make sure first cell has that green option... so you can ignore all warnings for that selection...
Just to confirm, the solution is only in Excel and not in SSRS?