Results 1 to 8 of 8

Thread: Crystal Report error in .net application

  1. #1
    Join Date
    Dec 2004
    Posts
    159
    Rep Power
    0

    Default Crystal Report error in .net application

    I get this error "Cannot find keycodev2.dll or invalid keycode" when i run a crystal report in my application when i deploy and install the application on the client machine. I want to find out what files i need to include in the setup package inorder to deploy files that are need for the report to work. I have tried everyting but nothing seems to solve the problem. i need urgent help.. anyone!!
    information you may need to assis me:
    i use crystal report 9.1 which is included with VS .NET 2003.
    It is also register.
    live good today cause u will never know wat will happen 2marrow and it was never promised to no man either

  2. #2
    Join Date
    Mar 2003
    Posts
    1,700
    Rep Power
    0

    Default

    To solve this problem, you need to include a couple of merge modules in the setup project for your application.

    If you are using the full version of Crystal Reports 9 with Visual Studio 2003, download the merge modules from the Crystal Technical Support web site.

    Once there, search for “cr9netmergemodules” to find the merge modules for Crystal Reports 9 and VS .NET corresponding to your language. It is likely that you will need the following four merge modules:
    1. reportengine.msm - The core files for the Crystal Reports engine. You will always need this merge module when deploying an application which uses Crystal Reports.

    2. crnetruntime.msm - Used to install the managed components (DLLs) required for the above module. You will always need this merge module as well.

    3. mapping.msm - Only include this module if you used Geographic Mapping in your Crystal Reports. Geographic mapping would be used for something like providing output for a Graphical Information System (as is used by the Ministry of Agriculture) or a GPS tracking report.

    4. license.msm - This is the licensing module. It is using to determine the licensing keycode for your Crystal Reports app. It is always required when deploying apps that use Crystal Reports.

    NOTE: When you include the license.msm, a LicenseKey property becomes available in the Properties pane, that accepts a keycode. The license key is emailed when the product is registered. This key is also available from the VS .NET Help | About… dialog, under the installed products list (which is most likely the case). The 19-digit license key must be entered into the LicenseKey property for the license.msm merge module.

    Failure to do so, will likely cause you to get this "Cannot find keycodev2.dll or invalid keycode" error when you install or deploy your application.

    Try this out and report back to us to let us know if it worked.

  3. #3
    Join Date
    Dec 2004
    Posts
    159
    Rep Power
    0

    Default

    i tried that but it dont work it still give me the same error. i am wonder if there are conflicting version of files in the .Net Cystal report and the merge module package files. can this be a proble,m too. Should exclude the packages from the .NET environment for the crystal report. please let me know.
    live good today cause u will never know wat will happen 2marrow and it was never promised to no man either

  4. #4
    Join Date
    Mar 2003
    Posts
    1,700
    Rep Power
    0

    Default

    The only reason why you would still get that error even after including the requisite merge modules is if your keycode is not entered into the LicenseKey property of the license.msm merge module. Did you copy/paste the license key from the Help | About window into the LicenseKey property?

  5. #5
    Join Date
    Dec 2004
    Posts
    159
    Rep Power
    0

    Default

    yes. i did insert the keycode. anyways, i found out what the problem was or i think i do but what i did was to exclude the merge module files from the setup project and then add these merge modules:
    1. crystal_managed2003.msm
    2. crystal_database_access2003.msm
    3. Crystal_regwiz2003.msm

    these are merge modules that comes with .NET software. i then entered the keycode in the LicenseKey property in the crysral_regwiz2003.msm module and it worked.

    The next problem i am having now is that everytime i run the crytal reports it keep asking for the connection information. and even if i enter the information it saids invalid login. what can i do to stop it from asking me for the connection information?
    live good today cause u will never know wat will happen 2marrow and it was never promised to no man either

  6. #6
    Join Date
    Mar 2003
    Posts
    1,700
    Rep Power
    0

    Wink So far so good

    Quote Originally Posted by samuelmitch
    yes. i did insert the keycode. anyways, i found out what the problem was or i think i do but what i did was to exclude the merge module files from the setup project and then add these merge modules:
    1. crystal_managed2003.msm
    2. crystal_database_access2003.msm
    3. Crystal_regwiz2003.msm
    - I assumed you knew which merge modules to include with your version of the software. I'm glad you found the right ones.

    Quote Originally Posted by samuelmitch
    these are merge modules that comes with .NET software. i then entered the keycode in the LicenseKey property in the crysral_regwiz2003.msm module and it worked.
    - Good job. Works everytime.

    Quote Originally Posted by samuelmitch
    The next problem i am having now is that everytime i run the crytal reports it keep asking for the connection information. and even if i enter the information it saids invalid login. what can i do to stop it from asking me for the connection information?
    - The problem you're having has to do with the fact that you are not using a class to summon access to your report documents. So everytime you open those reports, it's trying to find the database to which its fields are bound - hence you get the login information screen. Your dataset class already stores this information in it's related XML document (named: dataset#.xsd).

    To solve this problem, make the following modifications to your code:

    Code:
    'Declare report variables
        Private myDataSet As New YourDataSet()
        Private myReport As New YourReportClassName()
    
    'Assume that myDataAdapter is a data adapter object on your form. 
    'This line fills the dataset
        myDataAdapter.Fill("ReportTable", myDataSet)
    
    'Now attach your crystal report object to the tables in the dataset
            myReport.SetDataSource(dsUser)
            myReport.Database.Tables(0).SetDataSource(myDataSet)
            myReport.Database.Tables(1).SetDataSource(myDataSet)
            .
            .
            .
    'For as many tables in the dataset there are, which are used by your report...
            myReport.Database.Tables(n).SetDataSource(myDataSet)
    
    'Launch the report in your Crystal Report Viewer
            CrystalReportViewer1.ReportSource = myReport
    When you use this route, the report object uses the connection information exposed by your DataSet and DataConnection class objects, so you won't have to manually enter database login information.

    Problem solved.

    Cheers.

  7. #7
    Join Date
    Jul 2004
    Posts
    153
    Rep Power
    0

    Default

    xeno u seen verse on this topic... could u direct me to some site with good vb.net & crystal rep. info.

  8. #8
    Join Date
    Mar 2003
    Posts
    1,700
    Rep Power
    0

    Wink Crystal Reports for Visual Studio 2005

    (Better late than never)

    Sorry for taking so long to respond. I've been terribly busy @ work...

    Before you do a Google search, go to:

    http://msdn.microsoft.com/library/default.asp

    ...and search their libraries. The tech items there are invaluable. Failing which, you can also checkout:

    http://www.vbcity.com

    ...which is an excellent repository for Visual Basic code of all functions etc. VbCity is a forum just like TechJamaica. So you'll find lots of questions answered there as well.

    UPDATE for Visual Studio 2005: Deploying an Application which uses Crystal Reports

    If you build a Visual Studio 2005 application using Crystal Reports, you will encounter a similar problem as mentioned earlier by samuelmitch, even though the code for displaying such reports remains the same as shown earlier in this thread. The merge module needed for this application is still not included by default in Visual Studio 2005. So ensure to download it if you use this IDE. In fact, when you create a Setup and Deployment Project for your application, do the following:

    • Check in your \Program Files\Common Files\Merge Modules subfolder to ensure that you have the Microsoft_VC80_ATL_x86.msm and policy_8_0_Microsoft_VC80_ATL_x86.msm files. They should have been installed once you installed Visual Studio 2005.

    • Download the CrystalReportsRedist2005_x86.msm file from here. (Source page: Crystal Reports Merge Modules)

    • Copy it into your \Program Files\Common Files\Merge Modules subfolder.

    • In your Visual Studio 2005 application's Setup & Deployment Project, right click on the Setup project in your Project Explorer and select Add | Merge Module.

    • Add the CrystalReportsRedist2005_x86.msm to your project. The other two files mentioned earlier (i.e. Microsoft_VC80_ATL_x86.msm and policy_8_0_Microsoft_VC80_ATL_x86.msm) will be added automatically.

    • Build, deploy & install. Enjoy.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •