Click here to Skip to main content
Click here to Skip to main content

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

, 14 Jun 2011 CPOL
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.

Comments and Discussions

 
QuestionCrystal Reports failed to load report Pinmemberhughsm5-Jan-14 8:06 
GeneralMy vote of 5 Pinmemberbachitask89-Aug-12 9:31 
QuestionLoad REport failed. PinmemberShivani Sinha29-Apr-12 20:37 
AnswerRe: Load REport failed. Pinmvpthatraja25-May-12 7:05 
AnswerRe: Load REport failed. Pinmembersagarpatil0096-Oct-12 1:05 
GeneralMy 5 too. BTW My <a href="http://www.codeproject.com/Tips/29... Pinmvpthatraja28-Feb-12 19:37 
GeneralNice one. Have a 5 :) PinmemberNaerling28-Feb-12 12:37 
GeneralReason for my vote of 5 Saved my day! Pinmembermittjas3-Oct-11 6:20 
GeneralReason for my vote of 1 good Pingrouprahultiway1923-Sep-11 22:21 
GeneralRe: For good Tip/Tricks you should give 4 or 5, May be you click... Pinmvpthatraja16-Nov-11 5:42 
GeneralIt works...great post... Pinmembersonusona9-Aug-11 5:24 
GeneralReason for my vote of 5 It works and saved my time. PinmemberNarsimlu Keshagouni25-Mar-11 2: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.141220.1 | Last Updated 14 Jun 2011
Article Copyright 2010 by Gregory Gadow
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid