|
Subject:
|
Crystal10 error: system cannot find file specified
|
|
Posted By:
|
jnks2005
|
Post Date:
|
1/26/2007 12:23:32 PM
|
Hi, I am using ASP.Net 1.1, Crystal Report 10 with Oracle 10 as database. I have created several crystal reports from its IDE and stored under 'Reports' folder which is located under my web app's root folder. I have NOT added report to my project. Project does have reference to CrystalDecisions.CrystalReports.Engine and CrystalDecisions.Shared assemblies. Below is part of the code
''Imports Imports CrystalDecisions.CrystalReports.Engine Imports CrystalDecisions.Shared
''Declaration Dim crReportDocument as ReportDocument Dim crDatabase as Database Dim crTables as Tables Dim crTable as Table Dim crtableLogOnInfo as TableLogOnInfo Dim crConnectionInfo as ConnectionInfo
''Code (Partial) sPath = Server.MapPath("reports/MyTestReport.rpt") crReportDocument = New ReportDocument crReportDocument.Load(sPath) ''''This is the error line
crConnectionInfo = New ConnectionInfo With crConnectionInfo .ServerName = "CRServerName" .UserID = "MyCRUserID" .Password = "MYCRPwd" End With
crDatabase = crReportDocument.Database crTables = crDatabase.Tables
For Each crtable in crTables crTableLogOnInfo = crTables.LogOnInfo crTableLogOnInfo.ConnectionInfo = crConnectionInfo crTable.ApplyLogOnInfo(crtableLogOnInfo) Next
Me.CrystalReportviewer1.ReportSource = crReportDocument
=============================================================== I am getting error - The system cannot find the file specified. at crReportDocument.Load(sPath) line. Exception Details: System.Runtime.InteropServices.COMException:The system cannot find the file specified.
I checked, the file is physically there and I gone into debug mode also to verify.
Any Help will be appreciated.
KD
|
|
Reply By:
|
Imar
|
Reply Date:
|
1/26/2007 12:28:58 PM
|
Hi there,
Does your webserver account have the necessary permissions to read the file?
Imar --------------------------------------- Imar Spaanjaars http://Imar.Spaanjaars.Com Everyone is unique, except for me. Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004 Want to be my colleague? Then check out this post.
|
|
Reply By:
|
jnks2005
|
Reply Date:
|
1/26/2007 2:49:21 PM
|
I am testing this project on my development machine that has IIS installed. And as I mentioned .rpt file is saved under 'Report' folder under the web site root folder.
How can I check webserver account permissions to read the file?
Thx KD
|
|
Reply By:
|
Imar
|
Reply Date:
|
1/26/2007 4:48:09 PM
|
Take a look here: http://imar.spaanjaars.com/QuickDocId.aspx?quickdoc=263 and here: http://imar.spaanjaars.com/QuickDocId.aspx?quickdoc=287
HtH,
Imar --------------------------------------- Imar Spaanjaars http://Imar.Spaanjaars.Com Everyone is unique, except for me. Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004 Want to be my colleague? Then check out this post.
|
|
Reply By:
|
jnks2005
|
Reply Date:
|
1/26/2007 5:12:13 PM
|
Imar, Thanks.. I will check those articles and get back to you. Mean time Happy Weekend.
|
|
Reply By:
|
Imar
|
Reply Date:
|
1/26/2007 5:26:53 PM
|
You too....
Imar --------------------------------------- Imar Spaanjaars http://Imar.Spaanjaars.Com Everyone is unique, except for me. Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004 Want to be my colleague? Then check out this post.
|
|
Reply By:
|
jnks2005
|
Reply Date:
|
2/1/2007 1:08:59 PM
|
Imar, Sorry for delay. I have gone thru your articles. Great.. very clear understanding on what account is used behind the scene. These are the setting for IIS - Home Directory tab : Local Path : C:\Projects\MySystemName\MyWebApp Checkbox checked - Read, Log Visit, Index this resource Execute Permission - Script Only Application Protection - Medium (Pooled) - Directory Security tab : Annonymous Access - UN CHECKED Integrated Windows Auth - CHECKED - MachineName\ASPNET account privileges on 'Report' folder Folder physical location : C:\Projects\MySystemName\MyWebApp\Reports Checked - Read, Read & Execute, List Folder Content Note : - This intranet application is developed with VS2003 and Oracle DB on Win XP SP2 machine. - 'Report' folder only contain .rpt files. Report folder exists in project in VS IDE. I did not added report file in project to avoid strong reference which creates ReportFileName.vb file behind scene and adds to the project.
I tested changing Execute Permission from 'Script Only' to 'Scripts & Executables' but it did NOT solve the problem. Imar, how this setting affects application?
What else I need to check?
|
|
Reply By:
|
Imar
|
Reply Date:
|
2/1/2007 4:40:30 PM
|
Just to make sure it's a security issue, try making one of the accounts Administrator. Run the page and see if it works. Repeat until you found the account that works.
If it does work, remove the Admin group again and figure out what permissions you need to set. Maybe it's on a Temp folder, an Export folder, write access on the Reports folder and so on.
Also, look at this:
Folder physical location : C:\Projects\MySystemName\MyWebApp\Reports Checked - Read, Read & Execute, List Folder Content
Did you try giving it Full Control just to test things out? Maybe it writes temporary info to the folder?
That's all I can advice at this stage, as it's hard for me to see what's going on...
Imar --------------------------------------- Imar Spaanjaars http://Imar.Spaanjaars.Com Everyone is unique, except for me. Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004 Want to be my colleague? Then check out this post.
|
|
Reply By:
|
jnks2005
|
Reply Date:
|
2/2/2007 4:26:50 PM
|
Imar, Folder physical location : C:\Projects\MySystemName\MyWebApp\Reports I gave 'Full Control' to ASPNET user but still getting the error
I verified ASP.Net Temporary Folder 'C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files' permission, ASPNET account has 'Full Control' and still getting the error!!
|
|
Reply By:
|
Imar
|
Reply Date:
|
2/2/2007 6:37:01 PM
|
In that case, I am out of ideas. I don't know why the system can't find your file if you can confirm it's there.
Somehow, I still think it's a security problem, but from what I can see, you found the right account and tried about anything.
Sorry, out of ideas.... :-(
Imar --------------------------------------- Imar Spaanjaars http://Imar.Spaanjaars.Com Everyone is unique, except for me. Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004 Want to be my colleague? Then check out this post.
|
|
Reply By:
|
jnks2005
|
Reply Date:
|
3/9/2007 4:36:21 PM
|
I got solution to this and you wont believe it. These crystal reports were using oracle package and cursor to get data. All reports where using one package with package body. I split package body into individual procedures. Recompiled all procedures and packages. Recompiled reports again from Crystal Report IDE after making minor change. Though it is not convincing much but it is working now. Thank you Imar to suggest me trying out different options.
|