Click here to Skip to main content
15,795,331 members
Articles / Web Development / ASP.NET

Crystal Reports: Fix for "Load report failed" error.

Rate me:
Please Sign up or sign in to vote.
4.79/5 (17 votes)
14 Jun 2011CPOL1 min read 153K   7   13
Fix for "Load report failed" error in Crystal Reports
The problem: You want to display a Crystal Reports file programmatically on your website. When you try to open the report -- say, by calling the Load(Path) method of a ReportDocument object -- your code throws an exception with the message Load report failed. The inner exception reports Invalid file name, but you have verified that the path points right at a valid .rpt file. Perhaps the report mechanism worked just fine until you made some seemingly unrelated changes that affected system permissions.

The fix: When Crystal Reports opens a file, it uses the Windows temporary folder (typically C:\Windows\Temp\) as a scratch-pad. You need to give Crystal Reports explicit permission read and write to this folder.

How-to: Under XP, ASP.Net runs CR under ASPNET; with most of the Windows Server flavors, CR runs as NETWORK SERVICE. Make sure that this identity has permission to read and write to the Windows temporary folder.

Further: This issue seems to be limited just to ASP. In my office, we have CR embedded in several Windows Forms applications and have never had any problems. At a guess, CP runs with the permissions of the app's user, who automatically has the right access. We ran into this problem when our report server was demoted from being a domain controller, which reset things. I can't guarantee that this tip will work, but it may help prevent a very frustrating few days with your boss demanding hourly when the report server will be back on line.


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

Written By
United States United States
Gregory Gadow recently graduated from Central Washington University with a B.S. that combined economics and statistical analysis, and currently works for the Washington Department of Fish & Wildlife as an IT developer. He has been writing code for 30 years in more than a dozen programming languages, including Visual Basic, VB.Net, C++, C#, ASP, HTML, XML, SQL, and R.

Comments and Discussions

QuestionSame Error No complete solution Pin
Cesar Guillen13-Oct-15 11:27
Cesar Guillen13-Oct-15 11:27 
QuestionCrystal Reports failed to load report Pin
hughsm5-Jan-14 8:06
hughsm5-Jan-14 8:06 
GeneralMy vote of 5 Pin
bachitask89-Aug-12 9:31
bachitask89-Aug-12 9:31 
QuestionLoad REport failed. Pin
Shivani Sinha29-Apr-12 20:37
professionalShivani Sinha29-Apr-12 20:37 
AnswerRe: Load REport failed. Pin
thatraja25-May-12 7:05
professionalthatraja25-May-12 7:05 
AnswerRe: Load REport failed. Pin
sagarpatil0096-Oct-12 1:05
sagarpatil0096-Oct-12 1:05 
GeneralMy 5 too. BTW My <a href=" Pin
thatraja28-Feb-12 19:37
professionalthatraja28-Feb-12 19:37 
GeneralNice one. Have a 5 :) Pin
Sander Rossel28-Feb-12 12:37
professionalSander Rossel28-Feb-12 12:37 
GeneralReason for my vote of 5 Saved my day! Pin
mittjas3-Oct-11 6:20
mittjas3-Oct-11 6:20 
GeneralReason for my vote of 1 good Pin
rahultiway1923-Sep-11 22:21
rahultiway1923-Sep-11 22:21 
GeneralRe: For good Tip/Tricks you should give 4 or 5, May be you click... Pin
thatraja16-Nov-11 5:42
professionalthatraja16-Nov-11 5:42 
GeneralIt works...great post... Pin
sonusona9-Aug-11 5:24
sonusona9-Aug-11 5:24 
GeneralReason for my vote of 5 It works and saved my time. Pin
Narsimlu Keshagouni25-Mar-11 2:29
professionalNarsimlu Keshagouni25-Mar-11 2:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.