[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now



Posted on 2006-06-12
Medium Priority
Last Modified: 2009-12-16
Dear All,

Here's an intesresting question for you all!!

I'm using an Excel sheet as a data source for CR10 reports, and it has a field that sometimes may be less than 255 chrs for all records, or sometimes it may be more than 255.  Crystal tends to check the field to set the data type, and tries to fix up the report and switch from String to Memo when encountering different length fields. I'd like to override this auto switching and force the field to be treated as memo regardless.  I'm trying to write a COMMAND that will force something like...

SELECT CONVERT(MEmo, table.field)

but I know the syntax / function / is not correct for this.  Any idea what it should be?


Question by:davetheravesmith
  • 3
  • 2
LVL 16

Expert Comment

ID: 16885202
I would suggest one of the following:

convert(ntext, table.field)
convert(varchar(4000),table.field)<--preferrable method

Or you can do this in CR.  

Author Comment

ID: 16890460
That's great but it only seems to wrok in SQL views or on SQL data sources.  What I'd like to do is issue this using the Add Command area in CR, and in there it doesn't seem to work on an Excel data source.  It works fine using a SQL Server data source.  Could it be that DAO data sources such as Access / Excel can't recognise the CONVERT function?


LVL 16

Expert Comment

ID: 16893610
Yeah, DAO does not allow for the full functionality of SQL commands.  Your best bet is to do it in the report with a formula.  Then you can base any filters or anything else off of the formula.

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.


Author Comment

ID: 16897833
Thanks for this, but the original problem is that CR analyses the file initially, in which the field in question swtiches from <255 chrs to >255chrs, depending on what's in there this week.

So the original problem wouldn't be resolved as CR would detect the change and think the field has switched data types if you get my drift.

Is there a list somewhere of what SQL commands are valid / invalid for use the Add Command area of CR?


LVL 35

Expert Comment

ID: 16900872
I have no idea if you can do what you want in a Command in CR.  If you can't get that to work and CR has access to an SQL server, one option might be to read the Excel file in an SQL stored procedure, do your processing, and then use the stored procedure as the input to the CR report.  Although, for all I know, SQL could have the same limitation when reading the Excel file as CR does.  But it might be worth a try.

LVL 16

Accepted Solution

wykabryan earned 225 total points
ID: 16902023
I just tested this out.  

SELECT cstr(`Sheet1_`.`LOB Description`) as LOB
FROM   `Sheet1$` `Sheet1_`

This passed and pulls the information through.  It appear that when you use DAO some of the Crystal function become active.

Hope this helps.

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Integration Management Part 2
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses
Course of the Month19 days, 17 hours left to enroll

873 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