Link to home
Create AccountLog in
Avatar of Paulckw
Paulckw

asked on

Visual Studio and Crystal Report Conversion Problem

Hello Expert,

I have an small report application which originally written by visual studio 2003 (VB.net). The application will call and load external Crystal Report 10 (.rpt) files, and will display the report within a report viewer object.
Everytime when I installed the application in a new computer, i will need to manually register the following 3 files in order for it to work:
craxddrt.dll
craxdrt.dll
crviewer.dll

NOW, i am trying to convert all the VS project code into Visual Studio 2010 version. I simply open the VS2003 project file by VS2010, and the conversion will done automatically.

Everything goes fine and the application can run correctly under Visual Studio 2010 development environment.

However, after I generated a SETUP package and install it into another computer that WITHOUT Visual Studio 2010 installed, the following error occurs when run the program and click on a button to call the report viewer to display a report file:

System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {D21A9244-0817-46B1-AEF9-360BCE813BA9} failed due to the following error: 80040154.
 
Is there any way for me to find out which component is causing the problem with the given CLSID?    How can I find it under Visual Studio 2010 ?

Note: There is no problem when everything is generated by visual studio 2003.

thx,
Paul
Avatar of Mike McCracken
Mike McCracken

The RDC components you are using are not licensed for use with .Net and are not included with any versions after CR XI.  They are .COM components.

To use VS2010 you will need to convert to the .Net method of calling reports.

This may be helpful
http://msdn.microsoft.com/en-us/library/ms225492(v=vs.80).aspx

I have another link at home and will post it later

mlmcc
Avatar of Paulckw

ASKER

But why I can run it without problem in the machine that installed with Visual Stidio 2010 or 2008 ?
I guess your developer machine is 32 bits and your client machine is 64 bits . Is this correct ?
Avatar of Paulckw

ASKER

Oh yes!!!
You need to compile the program for "x86"  instead of "Any CPU"
Using COM objects restricts you to work in 32 bits world.
Avatar of Paulckw

ASKER

Can you show me more details on how to compile the program for x86 in visual studio 2010 ?
Right click on the project and select menu "Properties". Then select tab "Compile" and at the top you will see "Configuration" (Debug or Release both will work) and "Patform" -  this should be set to x86
Avatar of Paulckw

ASKER

I have just tried to compile it as x86 and then try to install the setup file in the client machine with 64 bits windows 7.
It works without the error now, but then the report only load up with a blank window without the report viewer and any data inside.

Moreover, when i run in debug mode in the visual studio 2010, it comes up with error with load the report, saying " cannot load 'Interop.CRAXDRT, Version=10.0.0.0, Culture=neutral, PublicKeyToken=null', ....system cannot find the specified file..."

But if I change back to compile with "Any CPU", the above error will not appear.
I didn't say it doesn't work, just that you are not licensed to build applications in VS 2008 or 2010.Net with it.

mlmcc
Did you deploy Interop.CRAXDRT.dll ?
Avatar of Paulckw

ASKER

The file interop.CRAXDRT.dll is placed under "Detected Dependencies" in the solution explorer in VS2010 (see attachment)

I found that the file is not exists in the x86 folder after the project compliled and built.
I have no idea how to deploy to make the files appear in the release x86 folder.

However, all the files exists when I compile using Any CPU mode or using VS2003 before.

I also have no idea why the following 3 files never can register automatically by the Setup package before, and I need to manually register by myself everytime after install:
craxddrt.dll
craxdrt.dll
crviewer.dll
vs2010-1.jpg
vs2010-2.jpg
ASKER CERTIFIED SOLUTION
Avatar of vasto
vasto
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of Paulckw

ASKER

As its too time consuming to rewrite the whole application...so i just want to make everything work in VS2010...

For the file Interop.CRAXDRT.dll  deploy problem, can just show me the details how can I make it deploy again in x86 release folder? thanks
This file is in your project bin folder. This is a .NET wrapper for CRAXDRT.dll. You need to install Crystal 10 runtimes on the client machine in order to use this file.
What is the purpose of this application ?

You will spend few hours to make it to work and you will probably succeed but then you will start finding problems between .NET and Crystal COM components and this will be a project which will never end. There are viewers on the market, developed with pure .NET without using COM components. For about $25 you will have more functionality without compatibility problems. Check this one http://www.r-tag.com/Pages/ReportManager.aspx. I was working for this company in the past and I know that there is no single COM object inside.
Avatar of Paulckw

ASKER

I have already installed Crystal 10 runtimes on the client machine but the problem still exist.
And for the Interop.CRAXDRT.dll  not found problem, it is actually in the development machine, which is under VS2010, but when I switch back to using Any CPU mode to compile and run, it doesnt has that problem.
Do you mean i need to install Crystal 10 runtimes in development machine?

Because I have created a lot of report files (.rpt) already and I dont want to re-create them again using new tools, as a new report tools need time to pickup and also need to rewrite codes in VS2010 to get them load
Avatar of Paulckw

ASKER

Or is there a way that I can simple change to use a new viewer object in the VB code to solve the problem?
I mean use a new viewer object to load my old report files that created by crystal report 10.
Do you have any sample code for that?
Agree it is on the development machine for backward compatibility but it is not for your use.

WHat version of Crystal was the application developed with?
You need to load that version of the runtimes on the client.

mlmcc
Avatar of Paulckw

ASKER

Hi mlmcc
i was using Crystal report 10 to build the reports, with the code converted from VS2003 to VS2010, then compiled with x86 mode.
I have already load Crystal report 10 runtime on the client machine and the viewer cannot come up, but just a blank vb form loaded.
thanks.
Avatar of Paulckw

ASKER

is there any viewer that can simply replace crviewer.dll ?
There is a .Net viewer you can use.

Since you are moving on to VS2010 you will probably be better to use the CR for VS2010 methods and assemblies in the application.  It can read and use CR10 reports.  You could also design the reports in the VS IDE and I believe gain some new capabilities.

I don't use the .Net versions but since CR 4 VS2010 is CRv13 I believe it includes the capabilities added in CR XI and CR2008

If you don't want to upgrade to the CR for VS2010 then you should be able to add the CR10 .Net assemblies to the project and replace the RDC components.
http://www.crystalreportsbook.com/Forum/forum_posts.asp?TID=1402

http://msdn.microsoft.com/en-us/library/ms225492(v=vs.80).aspx

mlmcc
Avatar of Paulckw

ASKER

Hi mlmcc,

I am now going to move to VS2012, so for CR for VS2012 methods that you mentioned, is that I need to download and install the CR for VS2012 separately?
Is that any quick sample / tutorial that can help me start.
What i simplely need is to create a quick application which can load all my CR 10 reports, and work under both 32 and 64bits machine.

By the way, i saw some suggestions from the web that ask me to remove all the reference of the old CR viewer objects in the project, and then install newer version of CR (e.g. CR13),
then add the reference to new objects again in the project.
Will this be hard?

As I found that the main problem now is that the CR objects like CRAXDRT.dll is not working under 64 bits windows 7.
I am not aware of a version for VS2012.  Just checked the SAP site and found no reference

mlmcc
Avatar of Paulckw

ASKER

by the way...i just installed VS2012...but i cannot find where to download CR for VS2012....is there CR for VS2012 or its not yet released?

I got CR for VS2010 installed before with VS2010....
I have seen nothing on a version of Crystal for VS2012.

mlmcc
There is still no CR version for VS2012. You can use the one for VS2010.  VS2012 and VS2010 are compatible, so you can even create the project initialy in VS2010 ( to use the templates) and open it after that in VS2012 ( although I cannot see any reason to develop it in VS2012)
Comments from SAP when they were creating/testing Crystal for VS2010 indicated they have untied the release of VS version specific Crystal from the release of VS.  I assume they are working on a version to use with VS2012 but I haven't seen anything to verify that or when it might be available
The version for VS2010 lagged VS2010 by at least 6 months

mlmcc
There are some threads on SAP forums which stated that there will be 2012 version, but nothing is released yet