Solved

Failed to open connection error in Crystal Reports

Posted on 2014-12-03
21
152 Views
Last Modified: 2014-12-15
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?
0
Comment
Question by:metalteck
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 8
  • 3
  • +1
21 Comments
 
LVL 18

Expert Comment

by:Simon
ID: 40479713
A while since I used Crystal - can't you open the report in design mode and avoid this?
Which version of Crystal?
0
 

Author Comment

by:metalteck
ID: 40479726
I'm trying to open it while in design mode and I'm using CR 2008.
0
 
LVL 18

Expert Comment

by:Simon
ID: 40479758
The only clue I could find: Is the file marked as read-only when you view its properties in Windows Explorer?
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

 
LVL 18

Expert Comment

by:vasto
ID: 40479763
Are the Oracle and SQL datbabases with the same structure ?
0
 

Author Comment

by:metalteck
ID: 40479898
The file was not read only. I changed it, but I still couldn't view the code. They are the same structure.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 40480123
You can't view the SQL unless you can connect to the database.

mlmcc
0
 
LVL 18

Expert Comment

by:vasto
ID: 40480150
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
0
 

Author Comment

by:metalteck
ID: 40481447
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?
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 40481560
Is the report based on a command or tables?

mlmcc
0
 

Author Comment

by:metalteck
ID: 40481608
On a command.
0
 
LVL 18

Expert Comment

by:vasto
ID: 40481625
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
0
 

Author Comment

by:metalteck
ID: 40481638
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.
0
 
LVL 18

Expert Comment

by:vasto
ID: 40481655
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.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 40481666
You can't see the SQL of a command unless you have the database available

mlmcc
0
 

Author Comment

by:metalteck
ID: 40481702
Here is the rpt file
0
 
LVL 18

Expert Comment

by:vasto
ID: 40481771
Sorry , I cannot see it. Is it attached ?
0
 

Author Comment

by:metalteck
ID: 40481784
0
 
LVL 18

Expert Comment

by:vasto
ID: 40481801
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')
0
 
LVL 18

Expert Comment

by:vasto
ID: 40481808
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
0
 

Author Comment

by:metalteck
ID: 40481872
Thanks so much. What did you do in order to view the code.
0
 
LVL 18

Accepted Solution

by:
vasto earned 500 total points
ID: 40482013
I used this tool: http://www.r-tag.com/Pages/CrystalSearch.aspx
It is documenting reports and showing the structure.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying 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

Suggested Solutions

Title # Comments Views Activity
Removing blank spaces between pivot table lines. 12 59
Sum of multiple formulas 6 28
Summarizing a percent by a grouped category 14 36
Timezone help 5 23
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. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

726 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