Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Professional
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 26th, 2007, 01:23 PM
Authorized User
 
Join Date: Jan 2007
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default Crystal10 error: system cannot find file specified

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

 
Old January 26th, 2007, 01:28 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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.
 
Old January 26th, 2007, 03:49 PM
Authorized User
 
Join Date: Jan 2007
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

 
Old January 26th, 2007, 05:48 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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.
 
Old January 26th, 2007, 06:12 PM
Authorized User
 
Join Date: Jan 2007
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Imar,
Thanks.. I will check those articles and get back to you.
Mean time Happy Weekend.

 
Old January 26th, 2007, 06:26 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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.
 
Old February 1st, 2007, 02:08 PM
Authorized User
 
Join Date: Jan 2007
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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?


 
Old February 1st, 2007, 05:40 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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.
 
Old February 2nd, 2007, 05:26 PM
Authorized User
 
Join Date: Jan 2007
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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\Temp orary ASP.NET Files' permission, ASPNET account has 'Full Control'
and still getting the error!!



 
Old February 2nd, 2007, 07:37 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to delete file System.IO.Delete error maricar C# 13 March 14th, 2014 06:50 AM
System cannot find file specified - Response.Redir cathiec BOOK: ASP.NET Website Programming Problem-Design-Solution 2 January 26th, 2006 05:18 AM
XslTransform/Could not find file error redeye2 Pro VB.NET 2002/2003 0 October 22nd, 2004 10:01 AM
system don't find vbc.exe file yln BOOK: Beginning ASP.NET 1.0 1 August 2nd, 2004 03:32 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.