Avatar of Metalteck
MetalteckFlag for United States of America

asked on 

Failed to open connection error in Crystal Reports

I'm trying to view the sql for a report I created at another job.
The db at the old job was oracle, while at the new job its sql.

When I try to view the sql code, I get a "Failed to open connection ORA-12154" error.

Any suggestions how I can get around this?
Crystal Reports

Avatar of undefined
Last Comment
vasto
Avatar of Simon
Simon
Flag of United Kingdom of Great Britain and Northern Ireland image

A while since I used Crystal - can't you open the report in design mode and avoid this?
Which version of Crystal?
Avatar of Metalteck
Metalteck
Flag of United States of America image

ASKER

I'm trying to open it while in design mode and I'm using CR 2008.
Avatar of Simon
Simon
Flag of United Kingdom of Great Britain and Northern Ireland image

The only clue I could find: Is the file marked as read-only when you view its properties in Windows Explorer?
Avatar of vasto
vasto
Flag of United States of America image

Are the Oracle and SQL datbabases with the same structure ?
Avatar of Metalteck
Metalteck
Flag of United States of America image

ASKER

The file was not read only. I changed it, but I still couldn't view the code. They are the same structure.
Avatar of Mike McCracken
Mike McCracken

You can't view the SQL unless you can connect to the database.

mlmcc
Avatar of vasto
vasto
Flag of United States of America image

If the Oracle and SQLServer databases are with the same structure you can set the report to use the SQL database and then go and check SQL. To switch to the SQL database select menu Database-> Set Database location , create a new connection the SQLDatabase and update the existing connection to the new one
Avatar of Metalteck
Metalteck
Flag of United States of America image

ASKER

I tried doing that, but get an Failed to retrieve data from database details 42000.
'SUBSTR' is not a recognized built in function name.

Any way I can get past this error?
Is the report based on a command or tables?

mlmcc
Avatar of Metalteck
Metalteck
Flag of United States of America image

ASKER

On a command.
Avatar of vasto
vasto
Flag of United States of America image

SUBSTR in ORACLE  is probably equivalent of SUBSTRING in SQLServer. You need to update the Command SQLto SQLServer syntax. What is the purpose to get the SQL from  the repor6t if it is based on Command? You can get the Command SQL
Avatar of Metalteck
Metalteck
Flag of United States of America image

ASKER

I need to duplicate the same report but instead of Oracle in SQL. I need to find out which tables I used and what logic I used. I'm not going to try and run that report, I just want to view the sql code.
Avatar of vasto
vasto
Flag of United States of America image

Can you upload the report here ?
The command will show you the full SQL. If you don't have anything else ( other commands, tables etc.) the command should contain everything you need.
You can't see the SQL of a command unless you have the database available

mlmcc
Avatar of Metalteck
Metalteck
Flag of United States of America image

ASKER

Here is the rpt file
Avatar of vasto
vasto
Flag of United States of America image

Sorry , I cannot see it. Is it attached ?
Avatar of Metalteck
Metalteck
Flag of United States of America image

ASKER

Avatar of vasto
vasto
Flag of United States of America image

SELECT  distinct
         WFWUQUEUE.WORKUNIT,
         WFWORKUNIT.WORK_TITLE,      
         SUBSTR(WFWORKUNIT.KEY_STRING,6) REQNUMBER,
         WFWORKUNIT.WF_RM_ID REQUESTER,
         WFWORKUNIT.WORK_CAT_VALUE,
         WFQUETASK.TASK,
         WFUSERCAT.WF_RM_ID APPROVER_ID,
         Z.FIRSTNAME,
         Z.LASTNAME
  FROM   LOGAN.WFWORKUNIT,
         LOGAN.WFWUQUEUE,
         LOGAN.WFQUETASK,
         LOGAN.WFUSERCAT,
         PROD.ZZWEBUSER Z
 WHERE       (WFWUQUEUE.WORKUNIT = WFQUETASK.WORKUNIT)
         AND (WFWUQUEUE.PROCESS_ID = WFQUETASK.PROCESS_ID)
         AND (WFWORKUNIT.WORKUNIT = WFWUQUEUE.WORKUNIT)
         AND (WFWUQUEUE.CATEGORY_VALUE = WFUSERCAT.WORK_CAT_VALUE)
         AND (WFQUETASK.TASK = WFUSERCAT.TASK)
         AND (WFQUETASK.R_STATUS = 1)  
         AND (Z.USERID = WFUSERCAT.WF_RM_ID)
         --and (WFWORKUNIT.WF_RM_ID = '&REQUESTER')
Avatar of vasto
vasto
Flag of United States of America image

There is also a record selection formula

{Command.REQUESTER} = {?Requester Id}

I would suggest you to add a parameter inside the command and handle the filtering there
Avatar of Metalteck
Metalteck
Flag of United States of America image

ASKER

Thanks so much. What did you do in order to view the code.
ASKER CERTIFIED SOLUTION
Avatar of vasto
vasto
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Crystal Reports
Crystal Reports

Crystal Reports is a business intelligence application from SAP SE. It is used to graphically design data connections and report layouts from a wide range of data sources including Excel spreadsheets, Oracle, SQL Server databases and Access databases, BusinessObjects Enterprise business views, and local file-system information. Report designers can place fields from these sources on the report design surface, and can also deploy them in custom formulas (using either BASIC or Crystal's own syntax), which are then placed on the design surface. Crystal Reports also supports subreports, graphing, and a limited amount of GIS functionality.

36K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo