Solved

My application is not finding the Crystal DLLs

Posted on 2006-11-22
13
1,954 Views
Last Modified: 2012-08-13
Hello Experts,

I am using crystal reports 11.5 in my web application, which is been built in Visual Studio 2003, and I am using DotNetNuke framework. The problem I am having is only in deployment computer. I do not have the problem in my development computer. My development and deployment computers both have windows 2003 server OS.
My development machine has Crystal Reports 11.5 developers edition installed.
I ran the redistribution package that come with Crystal 11.5, which is called CrystalRedist115_x86.msi, in my deployment machine. I noticed that the install created a folder in program files\business objects\common\35\managed and added some dlls.

The error that I am getting is

“DotNetNuke.Services.Exceptions.ModuleLoadException: File or assembly name CrystalDecisions.CrystalReports.Engine, or one of its dependencies, was not found”

When I add all the crystal’s DLLs to the bin folder of my application that error disappears; but I get another error. (I do not have the DLLs in my bin folder on my development machine)

“CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed. Error in File C:\WINDOWS\TEMP\IB_Daily_Transaction_Blotter {8FF2F0A8-BD78-41E1-89C8-668466A7B458}.rpt: Unable to connect: incorrect log on parameters”

I really do not know what is causing these errors. Could you pleaseeee help me? I will really appreciate you help

Thanks
Maria
0
Comment
Question by:mwcorrell
13 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 17997374
How are you passing the logon information?

mlmcc
0
 

Author Comment

by:mwcorrell
ID: 17997878
Hello mlmcc,

I have added 4 variable in the web.config file, which are the following :
   
    <add key="Servername" value="xxx"/>
    <add key="Databasename" value="yyy"/>
    <add key="Userid" value="zzz"/>
    <add key="Password" value="aaaa"/>

This variables are been used in the following sub. (This works great in the development machine and in another application in the deployment machine that is using crystal report 9)

Private Sub CreateReport(ByVal sReport As String, _
                         ByVal arParams As Array, _
                         Optional ByVal DoParams As Boolean = True)
            Dim oRpt As New ReportDocument
            Dim oSubRpt As New ReportDocument
            Dim Counter As Integer
            Dim crSections As Sections
            Dim crSection As Section
            Dim crReportObjects As ReportObjects
            Dim crReportObject As ReportObject
            Dim crSubreportObject As SubreportObject
            Dim crDatabase As Database
            Dim crTables As Tables
            Dim crTable As CrystalDecisions.CrystalReports.Engine.Table
            Dim crLogOnInfo As TableLogOnInfo
            Dim crConnInfo As New ConnectionInfo
            Dim crParameterValues As ParameterValues
            Dim crParameterDiscreteValue As ParameterDiscreteValue
            Dim crParameterRangeValue As ParameterRangeValue
            Dim crParameterFieldDefinitions As ParameterFieldDefinitions
            Dim crParameterFieldDefinition As ParameterFieldDefinition
            Dim crParameterFieldDefinition2 As ParameterFieldDefinition
            Dim strFile As String
            Dim fi As FileInfo
            Dim tstr As String
            Dim sPath As String
            Dim configurationAppSettings _
               As System.Configuration.AppSettingsReader = _
               New System.Configuration.AppSettingsReader
            Dim sReportPath As String = GetAbsoluteServerPath(Request) & "Reports\" & sReport
            Dim pos As Integer
            tstr = Microsoft.VisualBasic.Format(Now, "MM/dd/yyyy HH:mm:ss")
            strmessage = "Problem loading the Report"
            oRpt.Load(sReportPath)

            'log on to SQL server
            'Report code starts here
            'Set the database and the tables objects to the main report 'oRpt'
            crDatabase = oRpt.Database
            crTables = crDatabase.Tables
            'Loop through each table and set the connection info
            'Pass the connection info to the logon info object and then
            ' apply the logon info to the main report
            For Each crTable In crTables
                With crConnInfo
                    .ServerName = configurationAppSettings.GetValue("ServerName", GetType(System.String))
                    .DatabaseName = configurationAppSettings.GetValue("DatabaseName", GetType(System.String))
                    .UserID = configurationAppSettings.GetValue("UserID", GetType(System.String))
                    .Password = configurationAppSettings.GetValue("Password", GetType(System.String))
                End With
                crLogOnInfo = crTable.LogOnInfo
                crLogOnInfo.ConnectionInfo = crConnInfo
                crTable.ApplyLogOnInfo(crLogOnInfo)
                If (crTable.TestConnectivity()) Then
                    If (crTable.Location.IndexOf(".")) > 0 Then
                        crTable.Location = crTable.Location.Substring(crTable.Location.LastIndexOf(".") + 1)
                    Else
                        crTable.Location = crTable.Location
                    End If
                End If
            Next
            'Set the sections collection with report sections
            crSections = oRpt.ReportDefinition.Sections
            'Loop through each section and find all the report objects
            'Loop through all the report objects to find all subreport
            ' objects, then set the logoninfo to the subreport
            For Each crSection In crSections
                crReportObjects = crSection.ReportObjects
                For Each crReportObject In crReportObjects
                    If crReportObject.Kind = _
                       ReportObjectKind.SubreportObject Then
                        'If you find a subreport, typecast the reportobject
                        ' to a subreport object
                        crSubreportObject = CType(crReportObject, SubreportObject)
                        'Open the subreport
                        oSubRpt = _
                           crSubreportObject.OpenSubreport( _
                           crSubreportObject.SubreportName)
                        crDatabase = oSubRpt.Database
                        crTables = crDatabase.Tables
                        'Loop through each table and set the connection info
                        'Pess the connection info to the logoninfo
                        ' object then apply the logoninfo to the subreport
                        For Each crTable In crTables
                            With crConnInfo
                                .ServerName = _
                                   configurationAppSettings.GetValue("ServerName", _
                                  GetType(System.String))
                                .DatabaseName = configurationAppSettings.GetValue("DatabaseName", GetType(System.String))
                                .UserID = configurationAppSettings.GetValue("UserID", GetType(System.String))
                                .Password = configurationAppSettings.GetValue("Password", GetType(System.String))

                            End With
                            crLogOnInfo = crTable.LogOnInfo
                            crLogOnInfo.ConnectionInfo = crConnInfo
                            crTable.ApplyLogOnInfo(crLogOnInfo)
                        Next
                    End If
                Next
            Next
            ' Set the parameters
            If DoParams Then
                'Get the collection of parameters from the report
                crParameterFieldDefinitions = _
                   oRpt.DataDefinition.ParameterFields()
                For Counter = 0 To UBound(arParams) - 1
                    crParameterFieldDefinition = _
                       crParameterFieldDefinitions.Item(Counter)
                    '
                    'Get the current values from the parameter field.
                    crParameterValues = crParameterFieldDefinition.CurrentValues
                    If Not IsArray(arParams(Counter)) Then
                        'Test if param passed in matches CR param receiving
                        Dim test As String
                        Dim paramcounter As Integer
                        For paramcounter = 0 To UBound(arParams) - 1
                            ' Response.Write(arParams(paramcounter))
                            test = arParams(paramcounter)
                            ' Grabs param from CR and compares against param
                            ' passed in
                            If test.StartsWith(LCase(crParameterFieldDefinition. _
                               ParameterFieldName())) Then
                                                           test.Substring(test.IndexOf("=") + 1)
                                'Set the current values for the parameter field 0
                                crParameterDiscreteValue = New ParameterDiscreteValue
                                crParameterDiscreteValue.Value = _
                                   test.Substring(test.IndexOf("=") + 1)
                                'Add the first current value for the parameter field
                                crParameterValues.Add(crParameterDiscreteValue)
                               
                                Exit For
                            End If
                        Next
                    Else
                        crParameterRangeValue = New ParameterRangeValue
                        crParameterRangeValue.StartValue = arParams(Counter)(0)
                        crParameterRangeValue.EndValue = arParams(Counter)(1)
                        crParameterValues.Add(crParameterRangeValue)
                    End If
                    'All current parameter values must be applied for the
                    'parameter field.
                    crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)
                Next
            End If
        End sub

Thank you
Maria
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 17998091
Nothing jumps out.  Are you using the correct user/password?  DOes the user have database permissions?

mlmcc
0
 

Author Comment

by:mwcorrell
ID: 17998803
Yes, everything looks good.
I think the main question is why do I have to put the DLLs in the bin folder? My other applications do not need the dll in the bin folder.

Maria
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 17999184
I don't think they have to be in the bin folder but then I don't use the .Net version.  They do need to be registered.

mlmcc
0
 
LVL 17

Expert Comment

by:MIKE
ID: 18003741
Put the .dlls in the bin folder and see if in fact that is the issue....

MikeV
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:mwcorrell
ID: 18020009

When I placed the DLLs in the bin folder the following error disapears
 "System.IO.FileNotFoundException: File or assembly name CrystalDecisions.CrystalReports.Engine, or one of its dependencies, was not found."

But I get the
"Unable to connect: incorrect log on parameters. ---> CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed. Error in File C:\WINDOWS\TEMP\IB_Daily_Transaction_Blotter {8FF2F0A8-BD78-41E1-89C8-668466A7B458}.rpt: Unable to connect: incorrect log on parameters"

Thanks for the help

Maria
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 18020462
Do you know which line is getting the error?

mlmcc
0
 

Author Comment

by:mwcorrell
ID: 18021176
For the first error no: Here is the complete error message:

Message: DotNetNuke.Services.Exceptions.ModuleLoadException: File or assembly name CrystalDecisions.CrystalReports.Engine, or one of its dependencies, was not found. ---> System.IO.FileNotFoundException: File or assembly name CrystalDecisions.CrystalReports.Engine, or one of its dependencies, was not found. File name: "CrystalDecisions.CrystalReports.Engine" at DNNAdditional.SQLCrystalReportGrid.SQLCrystalReportGrid.CreateReport(String sReport, Array arParams, Boolean DoParams) at DNNAdditional.SQLCrystalReportGrid.SQLCrystalReportGrid.btnSearch_Click(Object sender, EventArgs e) === Pre-bind state information === LOG: DisplayName = CrystalDecisions.CrystalReports.Engine, Version=11.5.3300.0, Culture=neutral, PublicKeyToken=692fbea5521e1304 (Fully-specified) LOG: Appbase = file:///F:/WebSite/FHC LOG: Initial PrivatePath = bin Calling assembly : DNNAdditional.SQLCrystalReportGrid, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null. === LOG: Publisher policy file is not found. LOG: No redirect found in host configuration file (c:\windows\microsoft.net\framework\v1.1.4322\aspnet.config). LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\config\machine.config. LOG: Post-policy reference: CrystalDecisions.CrystalReports.Engine, Version=11.5.3300.0, Culture=neutral, PublicKeyToken=692fbea5521e1304 LOG: Attempting download of new URL file:///c:/windows/microsoft.net/framework/v1.1.4322/Temporary ASP.NET Files/fhc/7b5d4371/407fc2e5/CrystalDecisions.CrystalReports.Engine.DLL. LOG: Attempting download of new URL file:///c:/windows/microsoft.net/framework/v1.1.4322/Temporary ASP.NET Files/fhc/7b5d4371/407fc2e5/CrystalDecisions.CrystalReports.Engine/CrystalDecisions.CrystalReports.Engine.DLL. LOG: Attempting download of new URL file:///F:/WebSite/FHC/bin/CrystalDecisions.CrystalReports.Engine.DLL. LOG: Attempting download of new URL file:///F:/WebSite/FHC/bin/CrystalDecisions.CrystalReports.Engine/CrystalDecisions.CrystalReports.Engine.DLL. LOG: Attempting download of new URL file:///c:/windows/microsoft.net/framework/v1.1.4322/Temporary ASP.NET Files/fhc/7b5d4371/407fc2e5/CrystalDecisions.CrystalReports.Engine.EXE. LOG: Attempting download of new URL file:///c:/windows/microsoft.net/framework/v1.1.4322/Temporary ASP.NET Files/fhc/7b5d4371/407fc2e5/CrystalDecisions.CrystalReports.Engine/CrystalDecisions.CrystalReports.Engine.EXE. LOG: Attempting download of new URL file:///F:/WebSite/FHC/bin/CrystalDecisions.CrystalReports.Engine.EXE. LOG: Attempting download of new URL file:///F:/WebSite/FHC/bin/CrystalDecisions.CrystalReports.Engine/CrystalDecisions.CrystalReports.Engine.EXE. --- End of inner exception stack trace ---

For the second error YES:
Is in the oRpt.Export() line of the following piece of code

                    ExportFileName = exportpath & MyBase.UserInfo.Username.ToString() & commstmt & ".pdf"
                    oRpt.ExportOptions.ExportDestinationType = CrystalDecisions.[Shared].ExportDestinationType.DiskFile
                    oRpt.ExportOptions.ExportFormatType = CrystalDecisions.[Shared].ExportFormatType.PortableDocFormat
                    oDest.DiskFileName = ExportFileName
                    oRpt.ExportOptions.DestinationOptions = oDest
             oRpt.Export()
                    Dim strPortalAlias As String
                    Dim urlstring As String
                    strPortalAlias = GetPortalDomainName(PortalAlias.HTTPAlias, Request, False)
                    Response.RedirectLocation = "target=_blank"
                    Response.Redirect("http://" & strPortalAlias & "/export/" & MyBase.UserInfo.Username.ToString() &  commstmt & ".pdf", False)

Thanks

Maria
0
 

Author Comment

by:mwcorrell
ID: 18021196
This is the complete error message for the second error

Message: DotNetNuke.Services.Exceptions.ModuleLoadException: Logon failed. Error in File C:\WINDOWS\TEMP\IB_Daily_Transaction_Blotter {A12F1110-2D02-4988-A103-0BC69A3CD0EF}.rpt: Unable to connect: incorrect log on parameters. ---> CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed. Error in File C:\WINDOWS\TEMP\IB_Daily_Transaction_Blotter {A12F1110-2D02-4988-A103-0BC69A3CD0EF}.rpt: Unable to connect: incorrect log on parameters. ---> System.Runtime.InteropServices.COMException (0x8004100F): Logon failed. Error in File C:\WINDOWS\TEMP\IB_Daily_Transaction_Blotter {A12F1110-2D02-4988-A103-0BC69A3CD0EF}.rpt: Unable to connect: incorrect log on parameters. at CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions, RequestContext pRequestContext) at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext) --- End of inner exception stack trace --- at Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack, Boolean IgnoreReturn) at Microsoft.VisualBasic.CompilerServices.LateBinding.LateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack) at DNNAdditional.SQLCrystalReportGrid.SQLCrystalReportGrid.ExportDataformat(Object& oRpt) at DNNAdditional.SQLCrystalReportGrid.SQLCrystalReportGrid.CreateReport(String sReport, Array arParams, Boolean DoParams) at DNNAdditional.SQLCrystalReportGrid.SQLCrystalReportGrid.btnSearch_Click(Object sender, EventArgs e) --- End of inner exception stack trace ---
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 18021269
Verify you have the correct information in the config file and that it is being read correctly.

mlmcc
0
 
LVL 13

Accepted Solution

by:
EwaldL earned 500 total points
ID: 18063966
You need the dlls as Crystal is also using unmanaged code, not just managed.

The second error indicates that the report is not logged on correct at the database. To test things out, try hardcoding the logon information for   oRpt
0
 

Author Comment

by:mwcorrell
ID: 18169206
Hello Everyone,
 Thank you for all your comments.

  I am still having the same problem. I have tried everything, including hardcodign the logon parameters,  but nothing new. I am still getting the error:

DotNetNuke.Services.Exceptions.ModuleLoadException: Error in File F:\WebSite\FHC\Reports\IB_Daily_Transaction_Blotter.rpt: Unable to connect: incorrect log on parameters. ---> CrystalDecisions.CrystalReports.Engine.LogOnException: Error in File F:\WebSite\FHC\Reports\IB_Daily_Transaction_Blotter.rpt: Unable to connect: incorrect log on parameters. at .L(String , EngineExceptionErrorID ) at .G(Int16  , Int32 ) at CrystalDecisions.CrystalReports.Engine.Table.TestConnectivity() at DNNAdditional.SQLCrystalReportGrid.SQLCrystalReportGrid.CreateReport(String sReport, Array arParams, Boolean DoParams) in C:\Inetpub\wwwroot\FHC\SQLCrystalReportGrid\SQLCrystalReportGrid.ascx.vb:line 5635 at DNNAdditional.SQLCrystalReportGrid.SQLCrystalReportGrid.btnSearch_Click(Object sender, EventArgs e) in C:\Inetpub\wwwroot\FHC\SQLCrystalReportGrid\SQLCrystalReportGrid.ascx.vb:line 5470 --- End of inner exception stack trace ---

Any Other suggestion, pleaseeee.

Maria
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now