Click here to Skip to main content
11,577,643 members (23,461 online)
Click here to Skip to main content

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

, 14 Jun 2011 CPOL 178.6K 6
Rate this:
Please Sign up or sign in to vote.
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)

Share

About the Author

Gregory Gadow
Software Developer (Senior)
United States United States
Gregory Gadow lives in Seattle, Washington and has been writing code for almost 25 years in more than a dozen programming languages. He works for a mid-size brokerage firm and holds the Series 7 and Series 66 brokerage licenses, but much prefers working as the company's programming department doing VB6, VB.Net, ASP, HTML, XML and SQL.

You may also be interested in...

Comments and Discussions

 
QuestionCrystal Reports failed to load report Pin
hughsm5-Jan-14 7:06
memberhughsm5-Jan-14 7:06 
GeneralMy vote of 5 Pin
bachitask89-Aug-12 8:31
memberbachitask89-Aug-12 8:31 
QuestionLoad REport failed. Pin
Shivani Sinha29-Apr-12 19:37
memberShivani Sinha29-Apr-12 19:37 
AnswerRe: Load REport failed. Pin
thatraja25-May-12 6:05
mvpthatraja25-May-12 6:05 
AnswerRe: Load REport failed. Pin
sagarpatil0096-Oct-12 0:05
membersagarpatil0096-Oct-12 0:05 
GeneralMy 5 too. BTW My <a href="http://www.codeproject.com/Tips/29... Pin
thatraja28-Feb-12 18:37
mvpthatraja28-Feb-12 18:37 
GeneralNice one. Have a 5 :) Pin
Naerling28-Feb-12 11:37
memberNaerling28-Feb-12 11:37 
GeneralReason for my vote of 5 Saved my day! Pin
mittjas3-Oct-11 5:20
membermittjas3-Oct-11 5:20 
GeneralReason for my vote of 1 good Pin
rahultiway1923-Sep-11 21:21
grouprahultiway1923-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
mvpthatraja16-Nov-11 4:42 
GeneralIt works...great post... Pin
sonusona9-Aug-11 4:24
membersonusona9-Aug-11 4:24 
It works...great post...
GeneralReason for my vote of 5 It works and saved my time. Pin
Narsimlu Keshagouni25-Mar-11 1:29
memberNarsimlu Keshagouni25-Mar-11 1:29 

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

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

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150603.1 | Last Updated 14 Jun 2011
Article Copyright 2010 by Gregory Gadow
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid