Thoroughly solve the problem of CrystalReports login failure

xiaoxiao2021-03-06  36

Directory: 1. Crystal Reports 9 Latest Patch Download (Collection: Sea Wave .NET) Second, Cause 1: Folder NTFS Permissions. Third, the reason 2: PULL mode, database login problem in crystal report (non-Windows Integration Authentication). Fourth, the reason 3: Push mode Sets TableLogonInfo, no need! V. Error: Deploy to other computers, have problems: the connection failed. Error login parameters. Sixth, safety: How does CrystalReport integrate with NT (2K) Server? 7. Cause 4: PULL mode, database login issues in crystal reports (Windows Integration Authentication). -------------------------------------------------- ------------- Question: CrystalReports login failed logONEXCEPTION ------------------------------- ------------------------------- First, Crystal Reports 9 latest patch download (1) Crystal Reports 9 Database and Export Drivers Monthly Hot Fixhttp:? //support.crystaldecisions.com/communityCS/FilesAndUpdates/cr90dbexwin_en.zip.asp recDnlReq = Record & dnlPath = cr90dbexwin_en.zip (2) Crystal Reports 9 Developer Files Monthly Hot Fixhttp: //support.crystaldecisions.com/communityCS /FilesAndUpdates/cr90devwin_en.zip.asp?recDnlReq=Record&dnlPath=cr90devwin_en.zip(3)Crystal Reports 9.0 Main Program Files Monthly Hot Fixhttp:? //support.crystaldecisions.com/communityCS/FilesAndUpdates/cr90mainwin_en.zip.asp recDnlReq = Record & dnlPath = CR90MAINWIN_EN.ZIP ---------------------------------------------- ---------------- Second, the reason 1: Folder NTFS privileges. 1. Crystal Report Web Viewer Folder NTFS Permissions (1) Error Tip: The server error in the / WebApplication1 application. Login failed. Description: Execute an unprocessed exception during the current web request. Check the stack tracking information to learn more about the error and the code caused in the code. Abnormal Details: Crystaldecisions.crystalReports.Engine.logonexception: Login failed. (2) the relevant folder: VS.NET Crystal Reports: C: / Program Files / Microsoft Visual Studio .NET / Crystal Reports / ViewersCrystal 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 target folder NTFS permission when exported (1) Error Tip: Login failed. Description: Execute an unprocessed exception during the current web request. Check the stack tracking information to learn more about the error and the code caused in the code. Abnormal Details: Crystaldecisions.crystalReports.Engine.logonexception: Login failed. 3. Set "security" of the above folder, NTFS permissions: The easiest way is to add "full control" permissions to the Everyone user! (1) For the current user, such as Administrator, add "write" permissions; (2) to add "write" permissions to user ASPNET, System, anonymous user (usually IUSR_MACHINENAME), and add "write" permissions. -------------------------------------------------- ------------- Third, the reason 2: PULL mode, the login problem in the crystal report. Method for logging in to the database server (PULL mode) in the report, plus database connections. 1, is provided ReportDocument TableLogonInfo ...... 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 with table.applyLogonInfo (logonInfo) next table Crviewer.reportsource = reportDoc

2. If there are multiple related tables as the data source of the report, it is best to use a stored procedure or query as a data source.

3. Store "Database Connection Information" in the web.config configuration file, easy to maintain. Using crystaldecisions.shared; // Responsible for explaining TableLogonInfo class using crystaldecisions.crystalReports.Engine; // Responsible to explain the ReportDocument class

private void Page_Load (object sender, System.EventArgs e) {TableLogOnInfo logOnInfo = new TableLogOnInfo (); // declare a ReportDocument where objects must first Report, while loading data report ReportDocument oRpt = new ReportDocument (); // Get File .rpt Real path string path; path = server.mappath ("cr.rpt"); ORPT.LOAD (PATH); // Get logonInfo parameter information String A, B, C, D; // from Web.config String A, B, C, D; // Get servernamea = System.Configuration.ConfigurationSettings.AppSettings [ "servername"]; // Get DatabaseNameb = System.Configuration.ConfigurationSettings.AppSettings [ "database"]; // Get UserIdc = System.Configuration.ConfigurationSettings.AppSettings [ "userid"]; / / Get passwordd = System.Configuration.ConfigurationSettings.AppSettings [ "pass"]; // set the parameter logOnInfo logOnInfo.ConnectionInfo.ServerName = a; logOnInfo.ConnectionInfo.DatabaseName = b; logOnInfo.ConnectionInfo.UserID = c; logOnInfo.ConnectionInfo. Password = D;

ORPT.DATABASE.TABLES [0] .applylogonInfo (LogonInfo);

// Establish a connection between .RPT files and CrystalReportViewer files CrystalReportViewer1.Reportsource = ORPT;

Database ();} --------------------------------------------- ------------------ Four, the reason 3: Push mode set TableLogonInfo, no need! Because the data source is DataSet, not a database! -------------------------------------------------- ------------- V. Error: Deploy to other computers, generate problems: connection failed. Error login parameters. Running on the development machine (2000), everything is normal; transplanted to the production machine (2003), an error. Error Tip: The connection failed. Error login parameters. Solution: Deployment Bachel: Crystal_Database_access2003.msmcrystal_database_access2003_chs.msm These two merge modules contain various drivers for connecting data sources. So less, it is always prompted to log in failure (this tips are not very inexplicable?) ----------------------------- ---------------------------------- Six, safety: CrystalReport integration certification with NT (2K) SERVER integration? ? -------------------------------------- Safety three elements: simulation, verification, authorization --- ----------------------------------- If you run the ASP.NET program, you need to be an ASPNET account - run ASP.NET simulation account, do the following: To access SQL Server, you must establish "login" for this account (verification!); 3, and grant "server role" and "database access license", "database role" (authorization is also)! -------------------------------------- Reference: 1. Anonymous access to the web simulated account account Name: IUSR_Computer Name: Internet Guest account Description: Anonymous Access INTERNET Information Services Built-in account 2 -------------------------------------------------- ------------- Seven, reasons 4: PULL mode, Database login in crystal report (Windows Integration Authentication). 1. Error Tip: Server errors in the / mywebapp application. User 'pypc101 / aspnet' failed. 2, problem analysis: When designing a crystal statement, "Integrated Security" is used in "Connection Information" of "Database Expert", which is Windows Integration Authentication.

转载请注明原文地址:https://www.9cbs.com/read-116316.html

New Post(0)