Error after deloyment - when exporting report to .pdf- "Access to report file denied. Another program may be using it"

Hi,

I am using crystal reports with Visual Studio 2005. And that was working fine in development environment.
After I deployed it to server, It is giving me this error.

#######################################################
System.Exception: Load report failed. ---> System.Runtime.InteropServices.COMException (0x80000220): Error in File C:\WINDOWS\TEMP\rptInvoice {D21318F6-F9E2-4FDA-8CA9-95B11CB95993}.rpt:
Access to report file denied. Another program may be using it.
   at CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options)
   at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options)
   at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()

#######################################################


Here is my code that I am using to export crystal report to a .pdf file and I am saving this temporary file to one of my folder in my website directory which has full permissions for "NetWork Service" account.

#######################################################
ExportOptions exportOptions = new ExportOptions();DiskFileDestinationOptions diskFileDestinationOptions = new DiskFileDestinationOptions();PdfRtfWordFormatOptions formatTypeOptions = new PdfRtfWordFormatOptions();pdfFileName = "Inv" + "_" + System.DateTime.Now.Year + "_" + System.DateTime.Now.Month + "_" +System.DateTime.Now.Day + "_" +System.DateTime.Now.Hour + "_" + System.DateTime.Now.Minute + "_" + System.DateTime.Now.Second + "_" + System.DateTime.Now.Millisecond + ".pdf"; try{if (System.IO.Directory.Exists(appPath + "\\tempReports\\") == false){System.IO.Directory.CreateDirectory(appPath + "\\tempReports\\");}if (System.IO.File.Exists(appPath + "\\tempReports\\" + pdfFileName) == true){System.IO.File.Delete(appPath + "\\tempReports\\" + pdfFileName);}}catch (Exception ex2){Response.Write(ex2.Message);return;}diskFileDestinationOptions.DiskFileName = appPath + "\\tempReports\\" + pdfFileName;exportOptions.ExportDestinationType = ExportDestinationType.DiskFile;exportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;exportOptions.DestinationOptions = diskFileDestinationOptions;exportOptions.FormatOptions = formatTypeOptions;theReport.Export(exportOptions);applicationURL = HttpContext.Current.Request.Url.GetLeftPart(System.UriPartial.Authority) +"/" + HttpContext.Current.Request.ApplicationPath + "/";displayPDF_URL = applicationURL + "/" + "tempReports//" + pdfFileName;Response.Redirect(displayPDF_URL, false);


#######################################################


Now it seems like Crystal Reports is trying to extract some temp files using "C:\Windows\Temp" directory.
So Should I give "Network Service" permissions to "C:\Windows\Temp" directory also
OR
Can I change this crystal report's temporary extraction file path to any of my path instead of "C:\Windows\Temp"?
OR
Does crystal report use windows temp directory to create some temp files during the process?


Thanks


 

0
niravparekh
10/22/2008 9:35:45 PM
asp.net.crystal-reports 7043 articles. 0 followers. Follow

4 Replies
1022 Views

Similar Articles

[PageSpeed] 13

No problem, this is security problem we can solve this

in your web.config file there is a tag <identity> within this tag set impersonate=false if its yes then we should pass the userid and password of the windows login


If this post is answer of your question then don't forgot to Click Mark As Answer
0
jeyaseelan
10/23/2008 12:59:59 PM

Thanks for your reply.

Actually I tried giving full permissions to "C:\Windows\Temp" folder for "NetWork Service", and it worked.

Thanks again 

 

 

0
niravparekh
10/23/2008 2:45:04 PM

jeyaseelan@ajsquare.net:

No problem, this is security problem we can solve this

in your web.config file there is a tag <identity> within this tag set impersonate=false if its yes then we should pass the userid and password of the windows login

It worked great for me!!

Thanks a lot, you saved me hours of research

0
ckurtz
3/10/2009 10:46:57 PM

Niravparekh thanks for your feedback.

By your idea if you handover the project to client then the client wont allow to give the permission to Temp folder.


If this post is answer of your question then don't forgot to Click Mark As Answer
0
jeyaseelan
3/11/2009 3:50:45 AM
Reply:

Similar Artilces:

Crystal report error -- Access to report file denied. Another program may be using it.
Error in File C:\DOCUME~1\Somefolder\ASPNET\LOCALS~1\Temp\temp_f13a8b6f-2f62-484d-95de-2b71dd61fd4c.rpt: Access to report file denied. Another program may be using it. I get this error when running my web app and clicking on my icon which is to generate my pdf.  Some background -- I am very new to Crystal reports and I am creating a web demo from an existing web application which was developed by another developer (who is no longer available).  Most of the demo application now works after much trial and error and adding necessary reference data to the associated DB.  Now my ...

Error found "Access to the path "C:\Program Files\Microsoft Visual Studio .NET\Crystal Reports\Viewers" is denied. "
Hi guys! i'm trying to solve the error "Err Msg: "Object reference not set to an instance of an object" in ASP.NET app" but when i followed the instructions in the http://community.crystaldecisions.com/library/kbase/articles/c2011144.asp link, this error appeared ""Access to the path "C:\Program Files\Microsoft Visual Studio .NET\Crystal Reports\Viewers" is denied. " What's going on? i already went to the iis to add new virtual directory (CrystalReportWebFormViewer) but different error appeared when i compile and browse my application. pls help ...

Exporting the .pdf error: Access to report file denied. Another program may be using it.
I'm pretty new the Crystal Reports (2nd day .. please bear with me) I've gotten the report to view, but im running into problems in the export ... I am trying to export the report to .pdf, and keep getting this error message: Error in file. Access to report file denied. Another program may be using it. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: CrystalDecisions.CrystalReports.Engine.LoadSaveReportExcep...

Convert my reports from "Active Reports" to "Crystal Reports"
Hello, I discovered data dynamics active reports product a year ago while I was starting a new asp.net project and decided to use it as the reporting tool, it's a very nice product and have a lot of advantages over many other products in the market. However...I also discovered that although they clearly declare that they support Right To Left languages, they have a BIG issue when using Right To Left languages in ASP.NET.I've been writing them posts about this problem and asking when they are going to fix it for 8 months, and yet they did not give me an estimate time frame for fixing this i...

Access to the path "C:\Program Files\Microsoft Visual Studio .NET\Crystal Reports\Viewers" is denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.UnauthorizedAccessException: Access to the path "C:\Program Files\Microsoft Visual Studio .NET\Crystal Reports\Viewers" is denied. The ASP.NET process is not authorized to access the requested resource. For security reasons the default ASP.NET process identity is '{machinename}\ASPNET', which has limited privileges. Consider granting access rights to the...

"Logon failed error on Crystal Reports" when using oracle at backend and crystal reports
I am using VS.NET 2003 and oracle 8i database at backend. When I connect DB by ADO it connects and show tables and after making the report when I try to view it in browser there is an error of Logon failure on crystal reports. I am using VB.NET and ASP.NET. Kindly reply me soon. All in all I want to show reports in crystal reports from oracle 8i database. Haroon. can you post your code where you load the report--------------------------------------------------Sincerely,Michael ReyerosPlease remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if...

"Access to report file denied" error trying to gnerate a PDF
I am getting the following error when trying to generate a PDF using Crystal Reports from a web application: Exception Details: System.Runtime.InteropServices.COMException: Error in File C:\WINDOWS\TEMP\...filename.rpt: Access to report file denied. Another program may be using it.  I everything I have researched points to following the advice: http://blogs.aspadvice.com/rjdudley/archive/2005/03/14/3058.aspx I followed the instructions but am still getting the “access to report file denied” error.  The web application is using...

Report "Load report failed" while report using data field
hi all, I'm develop asp.net and crystal report from visual studio 2003 environment. all the completed program & report will place in 1 folder running by IIS5, currently the problem is: if the report is without using database fields is runnable and display well in my page; but if the report need to uses of database's field (no matter from xml or dataset), the page always throw error message "Load report failed", the stack trace always stop in the code "rpt.SetDataSource(ds)" or " rpt.Database.Tables(0).SetDataSource(ds.Tables("tbl1")" or "rpt.ExportToStream (CrystalDecisions.Shared.E...

How can I make a report with "Chart" on it by using "Rave Report"?
Dear All: How can I make a report with "Chart" on it by using "Rave Report"? Just like we did with "TQRChart" in "QuickReport". Thanks, Michael ...

Access to the path "dynamic_images" is denied using crystal reports
Hi, I ahave got similar problenm as yours. I am getting Access to the path "dynamic_images" is denied. I guessed it (dynamic_images) mapped to "C:\Microsoft Visual Studio .NET\Crystal Reports\Viewers\images" So I added NETWORK SERVICE user, as web site will be recognised by system by this name and provide all secuty permissions. I also added ASP.NET user and IUSR_GULIA (b coz GULIA is my machine name). I did could not get it working.....I tried whole day...I would appreciate you or any one else can help me get out of this riddle. Thank you very much. Hari...

Crystal Report give error "Load Report Failed"
Helloi in my Project I m using Crystal report,My Crystal report is Export in PDFi Have 150 fileapplication is first file export in pdf,then second file export pdf,in same say may be 30-40 file export in pdfbut after they give error load report faild, why this error will come.for run that application agian i have closed my VS and start again applicationwhy this will happen?  Nothing is really over,untill the moment stop trying for it...Amitsp(MCTS,MCP)sqlreporting.blogspot.com...

"Load Report Failed."
Hi Everyone, I have developed a report in VS2005 (On a Vista PC, in case that's relevant). In the report designer, I switch to "Main Report Preview" and the report shows up fine - it get the data from the database and displays perfectly. I tried to add a page to display the report in my app.  I added a crystal report viewer and a Crystal Report Source.  The report displays fine in design view.  However, when I run the app, all I get is "Load Report Failed". Please see the code below:<%@ Page Language="C#" M...

Access to report file denied. Another program may be using it.
Migrated from Windows 2000 ASP.NET 1.1 to Windows 2003, ASP.NET 2.0 and had this error. All the forums/MSDN/Blogs says to give Read/Write Access to C:\Windows\Temp folder. Why should we give Full Access to some folder in Production server?? In windows 2000, ASP.NET 2.0 development machine, no files are created when we run crystal reports from aspx pages. Then why in Windows 2003 servers, we need to give rights to temp folder?? It is a simple code crReportDocument.Load(Server.MapPath("Project.rpt")); And the code is not storing anything on the disk. Then why should it store the GUID.rpt f...

Access to report file denied. Another program may be using it.?????
ajkl 1) Does ASPNET user have modify permissions on the export directory also?2) If you're using Windows 2003, the user should be NetworkService, not ASPNET.If my post is your answer, please mark it as the answer. It will bring good karma.Crystal AllianceMy BlogFlorist Blogs I don't know which directory is the Export directory, do you know??I'm using windows XP.macca You set the export directory in this statement: string szFileName = ConfigurationSettings.AppSettings[Global.WarningReportsFilePath] + "warningletter.pdf"; Wherever Global.WarningReportsFilePath is set to needs ASPNET to...

Web resources about - Error after deloyment - when exporting report to .pdf- "Access to report file denied. Another program may be using it" - asp.net.crystal-reports

Resources last updated: 1/5/2016 4:20:58 PM