Link to home
Start Free TrialLog in
Avatar of Angel02
Angel02

asked on

Cannot find KeycodeV2.dll, or invalid keycode. when using Crystal Reports

We were running our web application on .NET 1.1 and SQL Server 2000. We are now upgrading to SQL Server 2008 (Hoping to use .NET 1.1).
So we set up a brand new server and installed the SQL Server 2008. .NET framework 2.0 and 3.5 were automatically installed. We  copied the project folders from the development server to the new server and published the website on the IIS 6 on new server. The problems is that crystal reports don't work. They give the error:

Cannot find KeycodeV2.dll, or invalid keycode.

We then custom installed the Visual Studio 2005 and selected Crystal Reports for Visual Studio. But id doesn't work.

What is the correct procedure? What is the problem with the distribution code? Please advise.
Avatar of Mike McCracken
Mike McCracken

Here is a tutorial on using tht specific version of Crystal and VS

http://www.businessobjects.com/global/pdf/dev_zone/VS2005_Walkthroughs.pdf

mlmcc
Avatar of Angel02

ASKER

Looks like I have to install Visual Studio Full Version on the server if I want Crystal Reports to work. Right?

But I wonder why I said VS 2005. My project uses Crystal Reports 9.2 for Visual Studio .NET 2003. I don't want to convert it to 2005. I want to stick with .NET 1.1. So should I install VS 2003 ?
You don't need the full version installed on the server.

Look at this
http://www.sdn.sap.com/irj/boc/go/portal/prtroot/docs/library/uuid/d089b100-a61d-2b10-0294-c701c2a541b2?QuickLink=index&overridelayout=true

Did you install the CR9 merge modules?

mlmcc
Avatar of Angel02

ASKER

Thanks for the link. The CR version mentioned on the development server is 9.1.5000. So I see the project is using Crystal Reports bundled with Visual Studio .NET 2003.

Here are the problems :
 (1) I have not installed the CR9 merge modules, because the steps ask for opening Visual studio and create a web set up project. The VS that got installed with SQL Server 2008, does not have any templates. I cannot create any project in there.

(2) I don't have any folder named "crystal Decisions"  in C:\ProgramFiles"C:\Program Files\Common Files\, hence no crystal decisions DLLs.

(3) When I look into the registry, I don't find the following keys at all

HKEY_CLASSES_ROOT\Interface\{4A4D268A-DF9B-4FC1-8301-D9FEEEF69F9C}
HKEY_CLASSES_ROOT\TypeLib\{8D43D0B9-C14E-4577-9E67-A9A1EEF82302}

SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Angel02

ASKER

I downloaded the merge modules. What do I do with them? Do i need Visual studio to add them?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Angel02

ASKER

I installed the web set up project as mentioned in the link. I also see the registry keys now.

The error that I get now is

Load crpe32.dll failed.

Is there something else missing? The error shows at the SetDatabaselogon call.
In SetDatabaselogon, I am using the username, password, server and database name, same as I used on my development machine. These are the credentials of the server from where my deployed web application is accessing the database.
What code are you using?

What version of Windows?
32 or 64 bit?

mlmcc
Avatar of Angel02

ASKER

Windows version is 32 bit.
Sorry, which code are you asking about ?
The code that calls the report.

What version of Windows?
There are issues with Win 7 and older versions of Crystal and VS.

mlmcc
Avatar of Angel02

ASKER

The code is below.
The deployment server is Windows Server 2003. Development Server is Window XP.
The project was built on development machine using VS 2003 and crystal Reports for VS.NET 2003.

'Code to generate report
Dim rptDoc As ReportDocument
Dim myDS As New myxsdFile
Dim the_id As Integer = Request.QueryString("theid")
       

        rptDoc = New myReportDoc
        rptDoc.SetDatabaseLogon(dbLogin, dbPwd, dbServer, dbName)
        BindReport(myDS, the_id)       'Populates the dataset
        rptDoc.SetDataSource(myDS)

      Dim crExpOpt As ExportOptions
        Dim crFile As DiskFileDestinationOptions
        Dim filename As String
        filename = "C:\testPdf.pdf"
       
        crFile = New DiskFileDestinationOptions
        crFile.DiskFileName = filename
        crExpOpt = rptDoc.ExportOptions
        With crExpOpt
            .DestinationOptions = crFile
            .ExportDestinationType = ExportDestinationType.DiskFile
            .ExportFormatType = ExportFormatType.PortableDocFormat
        End With
        rptDoc.Export()
       
            Response.ClearContent()
            Response.ClearHeaders()
            Response.ContentType = "application/pdf"
            Response.WriteFile(filename)
            Response.Flush()
            Response.Close()  
If you are passing a dataset to the report you don't need the database login since the report doesn't have a database.  Delete the line

mlmcc
Avatar of Angel02

ASKER

If I remove that line,

On development server, it works fine.

On deployment Server, now
rptDoc.SetDataSource(myDS) line is throwing "Load crpe32.dll failed."

I should also mention, that I had pasted the code for the simplest report to start with. I have other reports which use parameter fields. So I believe I will eventually need the SetDatabaseLogon line or else I would get "Logon Failed" error
What did you install on the server?

Did you install the mergre modules or the Crystal runtimes?

mlmcc
Avatar of Angel02

ASKER

I got it to work! I just copied crpe32.dll from C:\Program Files\Common Files\Business Objects\2.7\Bin to C:\WINDOWS\system32 and the report worked. I hope this method is right.

I would be glad if you could clarify one another thing. There still seems to be a problem.
The web project that I created works fine and all reports are generated successfully. There is an older project created by someone else. In that project, some simple reports without parameter fields, are working fine but other reports are throwing error.

- Failed to load database information

Do I assume they are exclusive errors in the reports?  What could possibly be a problem?
Avatar of Angel02

ASKER

Installing merge modules, copying crpe32.dll solved the problem. Thank you!