[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2025
  • Last Modified:

vb.net (Web) and crystal reports

I'm trying to add a crystal report to my vb.net web form and I keep getting configuration errors.  So i opened up a new project and only added the reportviewer to the form and started it and i got this error.  Which is the same error i would receive in the real project.  Is there something wrong with the viewer or am i missing something else.  The crystal reportview is in my Web Forms Control menu.  I have had crystal reports 8.5 installed for a few years on the computer, then when i installed the visual studio .net 2003, there is the option to install crystal so i choose to do that also.  I did not unistall 8.5 when installing .net.  I'm familiar with Crystal Reports and have used and setup many for VB6.  But can not figure out vb.net web Crystal Reports.  Help will be greatly appreciated!!!!!!!!!!

Thanks.

Error message below:

Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: File or assembly name CrystalDecisions.CrystalReports.Engine, or one of its dependencies, was not found.

Source Error:


Line 11:           debugging ASP.NET files.
Line 12:     -->
Line 13:     <compilation defaultLanguage="vb" debug="true"><assemblies><add assembly="CrystalDecisions.CrystalReports.Engine, Version=9.1.5000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add assembly="CrystalDecisions.ReportSource, Version=9.1.5000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add assembly="CrystalDecisions.Shared, Version=9.1.5000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add assembly="CrystalDecisions.Web, Version=9.1.5000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/></assemblies></compilation>
Line 14:
Line 15:     <!--  CUSTOM ERROR MESSAGES
 

Source File: F:\WebDev\Crystal2\web.config    Line: 13

Assembly Load Trace: The following information can be helpful to determine why the assembly 'CrystalDecisions.CrystalReports.Engine' could not be loaded.


=== Pre-bind state information ===
LOG: DisplayName = CrystalDecisions.CrystalReports.Engine, Version=9.1.5000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304
 (Fully-specified)
LOG: Appbase = file:///F:/WebDev/Crystal2
LOG: Initial PrivatePath = bin
Calling assembly : (Unknown).
===

LOG: Publisher policy file is not found.
LOG: No redirect found in host configuration file (C:\WINNT\Microsoft.NET\Framework\v1.1.4322\aspnet.config).
LOG: Using machine configuration file from C:\WINNT\Microsoft.NET\Framework\v1.1.4322\config\machine.config.
LOG: Post-policy reference: CrystalDecisions.CrystalReports.Engine, Version=9.1.5000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304
LOG: Attempting download of new URL file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/crystal2/3ba3e1b9/939031d9/CrystalDecisions.CrystalReports.Engine.DLL.
LOG: Attempting download of new URL file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/crystal2/3ba3e1b9/939031d9/CrystalDecisions.CrystalReports.Engine/CrystalDecisions.CrystalReports.Engine.DLL.
LOG: Attempting download of new URL file:///F:/WebDev/Crystal2/bin/CrystalDecisions.CrystalReports.Engine.DLL.
LOG: Attempting download of new URL file:///F:/WebDev/Crystal2/bin/CrystalDecisions.CrystalReports.Engine/CrystalDecisions.CrystalReports.Engine.DLL.
LOG: Attempting download of new URL file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/crystal2/3ba3e1b9/939031d9/CrystalDecisions.CrystalReports.Engine.EXE.
LOG: Attempting download of new URL file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/crystal2/3ba3e1b9/939031d9/CrystalDecisions.CrystalReports.Engine/CrystalDecisions.CrystalReports.Engine.EXE.
LOG: Attempting download of new URL file:///F:/WebDev/Crystal2/bin/CrystalDecisions.CrystalReports.Engine.EXE.
LOG: Attempting download of new URL file:///F:/WebDev/Crystal2/bin/CrystalDecisions.CrystalReports.Engine/CrystalDecisions.CrystalReports.Engine.EXE.

 

0
sborchers
Asked:
sborchers
  • 2
  • 2
1 Solution
 
BurntSkyCommented:
Quite simply, it can't find the DLL that contains the namespace 'CrystalDecisions.CrystalReports.Engine' (or it can't find the right version.)  The web.config file specifies that it needs the reference but when the application is loaded up the assembley can't be found (you can see all the directories it checks in the log you posted.)  Make sure you have the .dll on your machine and its in your application's /bin directory (or one of the other places it looks.)  If you manually add the reference to the project using VS.NET it should copy the .dll over to your /bin directory automatically.
0
 
sborchersAuthor Commented:
Ok, that kinda worked, the dll's i have on my computer show a different version number then what the project has.  But the web form loaded, but when i ran this code i got the error below.

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        CrystalReportViewer4.ReportSource = "CrystalReport1.rpt"
    End Sub

Error:
Cannot find KeycodeV2.dll, or invalid keycode.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: CrystalDecisions.CrystalReports.Engine.InternalException: Cannot find KeycodeV2.dll, or invalid keycode.

Source Error:


Line 31:
Line 32:     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Line 33:         CrystalReportViewer4.ReportSource = "CrystalReport1.rpt"
Line 34:     End Sub
Line 35: End Class
 

Source File: \\ares\wwwroot$\BurntSky\WebForm1.aspx.vb    Line: 33

Stack Trace:


[InternalException: Cannot find KeycodeV2.dll, or invalid keycode.]
   CrystalDecisions.Web.ReportAgent.h()
   CrystalDecisions.Web.ReportAgentBase.set_ReportSource(Object value)
   CrystalDecisions.Web.ReportAgent.set_ReportSource(Object value)
   CrystalDecisions.Web.CrystalReportViewerBase.set_ReportSource(Object value)
   BurntSky.WebForm1.Button1_Click(Object sender, EventArgs e) in \\ares\wwwroot$\BurntSky\WebForm1.aspx.vb:33
   System.Web.UI.WebControls.Button.OnClick(EventArgs e)
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
   System.Web.UI.Page.ProcessRequestMain()

 
0
 
BurntSkyCommented:
Well, that's obviously an issue with Crystal Reports then.  Here's a couple links I found that might help you out:

(from the crystal reports knowledge base:)
http://support.businessobjects.com/library/kbase/articles/c2011205.asp

http://codebetter.com/blogs/peter.van.ooijen/archive/2004/01/06/5225.aspx
0
 
sborchersAuthor Commented:
Thanks, I will take a look at the links today.  Is this code write to view a report on a web form:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        CrystalReportViewer4.ReportSource = "CrystalReport1.rpt"
    End Sub

Thanks again!
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now