Distributing Crystal Reports with a .NET solution

OK, I've got the reports working in my app.  They are based on
strongly-typed DataSets instead of talking to the SQL Server.  (I'll
post a write-up of how this is done once I get it together in a Word
document in the Files section).

Here is my problem:  When I distribute my app and try to run a report
from it, I get this error message:

Load crpe32.dll failed

If I install the CR Redistributable, I don't get the message.  
However, I don't want to have to install this because every
installation requires me to enter our developer licence key and we
are not going to have control of the distribution.  I know it can be
done without this, but I just don't know what I'm doing wrong.

This is what I've done so far:
I installed the redistributable on my development machine.
I've included the following MSMs in my setup project:
crnetruntime
mapping
reportengine
dotnetcrystalreports
crystal_managed2003
VC_CRT
VC_SLT
License - including my development key in the properties of this file.

I have another solution that I've styled this setup project from and
everything looks fine, but I just can't get crystal reports to play
nicely.

Anyone have any ideas?
dimondwoofAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

frodomanCommented:
0
GoodJunCommented:
Before you compile your setup project, make sure you put the license key property for the file installation properties.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dimondwoofAuthor Commented:
CR 9 - VS 2003 - VB.NET
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

dimondwoofAuthor Commented:
GoodJun - Are you talking about something different than setting the license key in the License.MSM file?
0
GoodJunCommented:
I am talking the regwiz.msm (or keycode.msm, they refer to the same thing in different documentation). I don't know the License.msm is the same thing or not?
I am using vs2002 and the cr shipped with vs.net.
0
dimondwoofAuthor Commented:
I think it is the same.  I tried to use the Crystal_RegWiz2003.MSM and had the same problem.
0
arvindb1Commented:
Create a setup and deployment project and follow step by step instructions provided in this guide.

http://support.crystaldecisions.com/communityCS/TechnicalPapers/crnet_deployment.pdf

Arvind
0
dimondwoofAuthor Commented:
I did that and now the setup package won't even run on the client machine.  It gets about 1/2 way done and throws a message listing a file (like CrystalDecisions.ReportAppServer.ClientDoc.dll, but it has thrown other, too) and says to check permissions on the directory, which it does NOT list.  I'm logged on to the machine as an administrator, so there are no directory restriction.  After the error, it reverses the install with no option.

The is SO frustrating.  I guess I have to pay Crystal's extortion fee to get them to tell me how to actually do this.  Have I mentioned that I HATE Crystal Reports?
0
dimondwoofAuthor Commented:
The document mentioned above did fix my problem EXCEPT the part where I needed to install the file cr90dbexwin_en.exe listed below.

For anyone out there that is struggling with this, these are the steps I took to fix this.  The configuration is VERY important, so if you're using any software other this this, you might need to do more research:

Windows 2000 Pro (not all that important)
Visual Studio 2003 (very important)
Crystal Reports 9 Upgrade (also refered to in the docs as a "full" version - also very important)
Reports in my project are filled using ADO.NET DataSets, NOT connecting to a data source like SQL.

Here are the quick and easy steps to getting this to work:
1. go out to Crystal Decisions web site and download the following:
  a. cr9netmergemodules - This is a zip file
  b. cr90dbexwin_en.exe
2. Install the cr90dbexwin_en.exe (required if you are using CR version 9 vs. version 9.2)
3. Expand the zip file.  These are the merge modules you'll need to add to your setup project.

In my setup project:
1. Add the merge modules from the zip file above.  The one you probably won't need to Mapping.msm because that is only for printing geographical information like maps.  Add your 19-digit key code (NOT the 10-digit registration number) to the License.msm.  The project won't build if you don't.
2. Add the following MSMs (this is where it is important to know which version of VS you are using.  These are for VS2003) - these files are required to get the reports that are based on the ADO.NET DataSets to work.
  a. VC_User_CRT71_RTL_X86_---.MSM
  b. VC_User_STL71_RTL_X86_---.MSM
3. IF you are using the FULL version of CR 9 - exclude the DotNetCrystalReports.msm from your dependancies folder.  This is VERY important.  The project will build and look normal (xcept you will get a list of warnings at the beginning of the build) but it will NOT install on the client because it's trying to install multiple versions of the same files in the client's GAC.  It will get part of the way through the install and throw an erronious message telling you to make sure you have permissions to some unknown directory.

Once I followed all these steps, I was able to get my app installed and the reports worked.

As for the reports themselves, this is what I did to get them to work:
I don't knwo if you have followed my posts so far, but I had reports that were written against a view n a SQL database.  To change them over to be based on DataSets, I did the following:

1. Build a strongly-typed DataSet in the app.  Do this by adding a data adapter to a form and generating a DataSet based on that.  You don't need to worry about permissions or anything like that, because the only reason for this is to generate the strongly-named dataset.  The result will end up as an XSD file in your project.  You have to base this on the view or table that the report is based on originally.  
2. Add the report to you app.
3. Right-click in the report window (but off of the report) and change the LocationSource from the database connection to the dataset you just generated.
4. In the function code that calls the report
  a. Create a new object based on the dataset.  
  b. Generate a table with your new data.  
  c. Add the table to the dataset object.
  d. Call the SetDataSource of the report.  Be sure to point to Table(1) of the dataset because when you add it to the dataset, it will be the second table (since this is a instance of the strongly-typed dataset that you created, there is already an empty table int he dataset.  Sounds weird, but that is what I found out).

If you try this and still have problems, you can contact me at keith.pinster@accent-inc.com.
0
Bob LearnedCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Split: GoodJun {http:#9682400} & arvindb1 {http:#9683577}

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

TheLearnedOne
EE Cleanup Volunteer
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.