Directory:
1. download the latest Crystal Reports 9 patch (Collection: Haibo. Net)
Ii. Cause 1: folder NTFS permission issues.
Iii. Cause 2: Pull Mode, database logon issues in the crystal report (non-Windows Integrated Identity Verification ).
4. Cause 3: tablelogoninfo is set in Push mode. No!
5. Error: deployed to other computers. Problem: Connection Failed. The logon parameters are invalid.
6. Security: How does crystalreport integration certification integrate with the NT (2 k) server?
7. Cause 4: Pull Mode, database logon issues in the crystal report (Windows Integrated Identity Verification ).
---------------------------------------------------------------
Problem:
Crystalreports Logon Failed
Logonexception
---------------------------------------------------------------
1. download the latest Crystal Reports 9 patch
(1) Crystal Reports 9 database and export Drivers monthly hot fix
Http://support.crystaldecisions.com/communityCS/FilesAndUpdates/cr90dbexwin_en.zip.asp? Recdnlreq1_record&dnlpath=cr90dbexwin_en.zip
(2) Crystal Reports 9 developer files monthly hot fix
Http://support.crystaldecisions.com/communityCS/FilesAndUpdates/cr90devwin_en.zip.asp? Recdnlreq1_record&dnlpath=cr90devwin_en.zip
(3) Crystal Reports 9.0 main program files monthly hot fix
Http://support.crystaldecisions.com/communityCS/FilesAndUpdates/cr90mainwin_en.zip.asp? Recdnlreq1_record&dnlpath=cr90mainwin_en.zip
---------------------------------------------------------------
Ii. Cause 1: folder NTFS permission issues.
1. About NTFS permission in the Web Viewer folder of the Crystal Report
(1) error message:
"/Webapplication1" ApplicationProgram Server error.
? Logon Failed.
? Note: An unhandled exception occurs during the execution of the current Web request. Check the stack trace information to learn about this error and Code Detailed information about the cause of the error.
? Exception details: crystaldecisions. crystalreports. Engine. logonexception: Logon Failed.
(2) related folders:
Vs. NET Crystal Reports: C: \ Program Files \ Microsoft Visual Studio. NET \ Crystal Reports \ viewers
Crystal Reports 9.2: C: \ Program Files \ common files \ crystal decisions \ 2.0 \ crystalreportviewers
2. the folder where the crystal report file is located or the NTFS permission of the target folder during export
(1) error message:
Logon Failed.
Note: An unhandled exception occurs during the execution of the current Web request. Check the stack trace information for details about the error and the source of the error in the code.
Exception details: crystaldecisions. crystalreports. Engine. logonexception: Logon Failed.
3. Set the "Security" of the preceding folder, that is, the NTFS permission:
The simplest way is to grant "Full Control" permissions to everyone users!
(1) Add the write permission to the current user, such as administrator;
(2) Add "write" permissions for user ASPnet, system, anonymous users (usually IUSR_machinename), authenticated users.
---------------------------------------------------------------
Iii. Cause 2: Database logon problems in the Crystal Report in the PULL mode.
How to log on to the database server at runtime (PULL mode)
Add the database connection to the CS file of the report.
1. Set tablelogoninfo of reportdocument ......
Dim reportdoc as new reportdocument ()
Dim logoninfo as new tablelogoninfo
Dim table as table
Reportdoc. Load ("C: \ rpts \ publish. rpt ")
For each table in reportdoc. database. Tables
Logoninfo = table. logoninfo
With logoninfo. connectioninfo
. Servername = "localhost"
. Databasename = "pubs"
. Userid = "sa"
. Password = ""
End
Table. applylogoninfo (logoninfo)
Next table
Crviewer. reportsource = reportdoc
2. If multiple related tables are used as the report data source, it is best to use stored procedures or queries as the data source.
3. Store "database connection information" in the web. config configuration file, which is easy to maintain.
Using crystaldecisions. Shared; // explains the tablelogoninfo class
Using crystaldecisions. crystalreports. Engine; // explains the reportdocument class.
Private void page_load (Object sender, system. eventargs E)
{
Tablelogoninfo logoninfo = new tablelogoninfo ();
// Here, you must declare a reportdocument object report and load the data report.
ReportDocument orpt = new reportdocument ();
// Obtain the real path of the. rpt file
String path;
Path = server. mappath ("cr. rpt ");
Orpt. Load (PATH );
// Obtain the logoninfo parameter information from web. config.
String a, B, c, d;
// Obtain servername
A = system. configuration. configurationsettings. deleettings ["servername"];
// Obtain databasename
B = system. configuration. configurationsettings. deleettings ["Database"];
// Obtain the userid
C = system. configuration. configurationsettings. receivettings ["userid"];
// Obtain the password
D = system. configuration. configurationsettings. receivettings ["pass"];
// Set the logoninfo Parameter
Logoninfo. connectioninfo. servername =;
Logoninfo. connectioninfo. databasename = B;
Logoninfo. connectioninfo. userid = C;
Logoninfo. connectioninfo. Password = D;
Orpt. database. Tables [0]. applylogoninfo (logoninfo );
// Establish a connection between the. rpt file and the crystalreportviewer File
Crystalreportviewer1.reportsource = orpt;
Databind ();
}
---------------------------------------------------------------
4. Cause 3: tablelogoninfo is set in Push mode. No!
Because the data source is dataset, not a database!
---------------------------------------------------------------
5. Error: deployed to other computers. Problem: Connection Failed. The logon parameters are invalid.
Running on the development machine (2000), everything is normal; porting to the production machine (2003) will result in an error. Error message: Connection Failed. The logon parameters are invalid.
Solution:
The deployment package has something missing:
Crystal_database_access2003.msm
Crystal_database_access2003_chs.msm
These two merging modules contain drivers for various data sources. Therefore, when it is missing, the system always prompts logon Failure (is this prompt confusing ?)
---------------------------------------------------------------
6. Security: How does crystalreport integration certification integrate with the NT (2 k) server ??
--------------------------------------
Three elements of security:
Simulate, verify, and authorize
--------------------------------------
To run the ASP. NET program, you also need to set ASP. Net account to run the account simulated by ASP. NET:
1. when accessing the server through the Web, the visitor "simulates" The Internet Guest account by default. Account name: IUSR _ computer name;
2. The "IUSR _ computer name" account must create a "login" for the Account to access SQL Server (verification is also required !);
3. Grant "server role", "database access permission", and "database role" (authorization is also required )!
--------------------------------------
Refer:
1. Anonymous Access to the simulated Web account
Account name: IUSR _ computer name
Full name: Internet Guest Account
Description: The built-in account for anonymous access to Internet Information Service.
2. Run the account simulated by ASP. NET
Account name: ASPnet
Full name: aspnet_wp account
Description: account used to run the ASP. NET workflow.
---------------------------------------------------------------
7. Cause 4: Pull Mode, database logon issues in the crystal report (Windows Integrated Identity Verification ).
1. error message:
A server error occurs in the "/mywebapp" application.
User 'pypc101 \ aspnet' Login Failed.
2. Problem Analysis:
When designing a crystal report, "Integrated Security" is used in "connection information" of "database experts", that is, Windows Integrated Identity Authentication.
3. solution:
To add database logon and access permissions to the ASPNET account ......
But this is not suitable. It is best to use the identity authentication of the database server to log on with the server account, such as sa!
4. Reference: III. Cause 2: Database logon problems in the crystal report.