Click here to Skip to main content
15,920,576 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi!

Whenever I attempt to open the Crystal Reports in my .net application, I get an exception

The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception


How to fix it?
Please help me as soon as possible!
Posted
Updated 28-Apr-11 21:29pm
v4

' ' DotNetNuke® - http://www.dotnetnuke.com

' Copyright (c) 2002-2007

' by DotNetNuke Corporation

'

' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated

' documentation files (the "Software"), to deal in the Software without restriction, including without limitation

' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and

' to permit persons to whom the Software is furnished to do so, subject to the following conditions:

'

' The above copyright notice and this permission notice shall be included in all copies or substantial portions

' of the Software.

'

' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED

' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL

' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF

' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER

' DEALINGS IN THE SOFTWARE.

'

Imports System.Web.Services.Protocols

Imports System.Diagnostics

Imports System.Reflection

Imports DotNetNuke.Services.Personalization



Namespace DotNetNuke.Modules.IWebXAML

' class that is passed in through the soap header

Public Class IWebXAMLAuthendicationHeader

Public PortalID As Integer

Public UserID As Integer

Public Password As String

Public Username As String

Public ModuleId As Integer

End Class



Public Class IWebXAMLAuthendication

' const values

Private Class Consts

Public Const LoginErrorMessage As String = "Login failed. Invalid credentials supplied to the web service method."

End Class



Private _MethodName As String

Private _PortalID As Integer

Private _UserID As Integer

Private _Password As String

Private _Username As String

Private _ModuleId As Integer



#Region "Constructors"

Public Sub New(ByVal IWebCredentials As IWebXAMLAuthendicationHeader)



_PortalID = IWebCredentials.PortalID

_ModuleId = IWebCredentials.ModuleId

_UserID = IWebCredentials.UserID

_Password = IWebCredentials.Password

End Sub

#End Region



Public Function IsUserValid() As Boolean

Dim loginStatus As Security.Membership.UserLoginStatus

Dim strEncryptionKey As String



' Get the Key from Personalization

Dim PersonalizationController As New PersonalizationController()

Dim PersonalizationInfo As New PersonalizationInfo()

PersonalizationInfo = PersonalizationController.LoadProfile(_UserID, _PortalID)



If Not Personalization.GetProfile(PersonalizationInfo, _ModuleId.ToString, "SilverlightKey") Is Nothing Then

If CType(Personalization.GetProfile(PersonalizationInfo, _ModuleId.ToString, "SilverlightKey_Expires"), DateTime) < DateTime.Now() Then

'Expired Encryption Key

Return False

End If

strEncryptionKey = CType(Personalization.GetProfile(PersonalizationInfo, _ModuleId.ToString, "SilverlightKey"), String)



If _Password = strEncryptionKey Then

Dim SilverlightUser As New UserInfo()

SilverlightUser = UserController.GetUser(_PortalID, _UserID, False)

_Password = UserController.GetPassword(SilverlightUser, "").ToString()

_Username = SilverlightUser.Username

Else

Return False

End If

End If



Dim objUser As UserInfo = UserController.ValidateUser(_PortalID, _Username, _Password, "", "", "255.255.255.1", loginStatus)

If objUser Is Nothing Then

Return False

Else

Return True

End If

End Function



Public Function GetUserInfo() As UserInfo

Dim loginStatus As Security.Membership.UserLoginStatus

Return UserController.ValidateUser(_PortalID, _Username, _Password, "", "", "255.255.255.1", loginStatus)

End Function

page balaram


End Class
 
Share this answer
 
v2
Comments
Sandeep Mewara 29-Apr-11 4:08am    
1. What is this? Answer to question? Elaborate
2. Put the code part in PRE tags. It makes it readable.
<pre><code>&gt;&lt;<strike></strike></code></pre>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900