Click here to Skip to main content
15,867,453 members
Articles / Web Development / ASP.NET
Tip/Trick

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 154.6K   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.

License

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 10:27
Cesar Guillen13-Oct-15 10:27 
QuestionCrystal Reports failed to load report Pin
hughsm5-Jan-14 7:06
hughsm5-Jan-14 7:06 
GeneralMy vote of 5 Pin
bachitask89-Aug-12 8:31
bachitask89-Aug-12 8:31 
QuestionLoad REport failed. Pin
Shivani Sinha29-Apr-12 19:37
professionalShivani Sinha29-Apr-12 19:37 
AnswerRe: Load REport failed. Pin
thatraja25-May-12 6:05
professionalthatraja25-May-12 6:05 
AnswerRe: Load REport failed. Pin
sagarpatil0096-Oct-12 0:05
sagarpatil0096-Oct-12 0:05 
GeneralMy 5 too. BTW My <a href="http://www.codeproject.com/Tips/29... Pin
thatraja28-Feb-12 18:37
professionalthatraja28-Feb-12 18:37 
My 5 too. BTW My alternate Tip/Trick is extended version of yours, cheers.
GeneralNice one. Have a 5 :) Pin
Sander Rossel28-Feb-12 11:37
professionalSander Rossel28-Feb-12 11:37 
GeneralReason for my vote of 5 Saved my day! Pin
mittjas3-Oct-11 5:20
mittjas3-Oct-11 5:20 
GeneralReason for my vote of 1 good Pin
rahultiway1923-Sep-11 21:21
rahultiway1923-Sep-11 21:21 
GeneralRe: For good Tip/Tricks you should give 4 or 5, May be you click... Pin
thatraja16-Nov-11 4:42
professionalthatraja16-Nov-11 4:42 
GeneralIt works...great post... Pin
sonusona9-Aug-11 4:24
sonusona9-Aug-11 4:24 
GeneralReason for my vote of 5 It works and saved my time. Pin
Narsimlu Keshagouni25-Mar-11 1:29
professionalNarsimlu Keshagouni25-Mar-11 1: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.