Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Database linking to Excel spreadsheet Post Reply Post New Topic
Author Message
Parker
Newbie
Newbie


Joined: 23 Jun 2012
Location: Oman
Online Status: Offline
Posts: 1
Quote Parker Replybullet Topic: Database linking to Excel spreadsheet
     Posted: 23 Jun 2012 at 2:13am
I have a long database text field which has 5 characters at the start which I would like to make use of.
 
I have an Excel spreadsheet with 2 columns the 5 character code and a long description.
 
I'd like to link the first 5 characters of the long database field with the Excel spreadsheet so that I can use the description in the report.
 
I am quite an experienced Crystal report user but I am only really familiar with using the tool in its as presented format, i.e. I don't get into the SQL or insides of the tool.
 
In a situation where the code is a seperate field in the database I would just add a link in the database expert.
 
I hope someone has a simple approach to this question, my alternate approach is to create the field in the database for this use, but it strikes me that there should be another way.
 
Any help gratefully received.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 25 Jun 2012 at 3:40am
Try this:
 
1.  Create a SQL Expression that looks something like this (I'll call this Text_Code) :
 
substring('Table'.'Long_Text', 1, 5)
 
2.  In the Select Expert, modify the selection formula and add something like this:
 
{%Text_Code} = {excel_sheet.Text_Code}
 
-Dell
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum