Solved

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

Posted on 2011-02-22
19
1,114 Views
Last Modified: 2012-05-11
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.

0
Comment
Question by:rhservan
  • 10
  • 9
19 Comments
 
LVL 51

Expert Comment

by:HainKurt
ID: 34954191
try wrapping it into " for that column

expression = '"' + ... + '"'
0
 

Author Comment

by:rhservan
ID: 34954397
Here is the expression that I placed on that field:

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

This worked only on the alphanumeric but not the numeric only.
0
 
LVL 51

Expert Comment

by:HainKurt
ID: 34954441
try

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

0
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 

Author Comment

by:rhservan
ID: 34954560

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.
0
 

Author Comment

by:rhservan
ID: 34954590
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.
0
 
LVL 51

Expert Comment

by:HainKurt
ID: 34954624
what is your query?
0
 

Author Comment

by:rhservan
ID: 34954711
Is there a particular part of the query you need to view?
0
 
LVL 51

Expert Comment

by:HainKurt
ID: 34955093
the part for "aaa1111"
0
 

Author Comment

by:rhservan
ID: 34955270
Here is the query.
EESample.txt
0
 
LVL 51

Expert Comment

by:HainKurt
ID: 34955404
which column is creating issue?
0
 

Author Comment

by:rhservan
ID: 34955481
Trailernumber
0
 
LVL 51

Expert Comment

by:HainKurt
ID: 34955596
also can you please post a sample excel file that shows the issue...
0
 

Author Comment

by:rhservan
ID: 34955830
Excel in .png format png file from snagit
0
 
LVL 51

Expert Comment

by:HainKurt
ID: 34956025
can you please post a small sample of that excel file
0
 
LVL 51

Expert Comment

by:HainKurt
ID: 34956026
as an excel file, attachement I mean
0
 

Author Comment

by:rhservan
ID: 34956126
Here you go.
EESamplexls.xls
0
 
LVL 51

Accepted Solution

by:
HainKurt earned 500 total points
ID: 34956227
when you select  A2:A15 and click the icon -> Ignore error it goes away
or go to error checking options and uncheck "enable background error checking"

what happens is you enter the heading and excel thinks that column is text
and when you enter a numeric value under that, excel warns you...

it is not a big deal... when a numeric data is entered "12345" excel puts it as text and adds that warning...
0
 
LVL 51

Expert Comment

by:HainKurt
ID: 34956231
when you select a range make sure first cell has that green option... so you can ignore all warnings for that selection...
0
 

Author Comment

by:rhservan
ID: 34961077
Just to confirm, the solution is only in Excel and not in SSRS?
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used.

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question