Wrox Programmer Forums
|
BOOK: ASP.NET Website Programming Problem-Design-Solution
This is the forum to discuss the Wrox book ASP.NET Website Programming: Problem - Design - Solution, Visual Basic .NET Edition by Marco Bellinaso, Kevin Hoffman; ISBN: 9780764543869
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET Website Programming Problem-Design-Solution 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 August 16th, 2005, 05:22 AM
Authorized User
 
Join Date: Jun 2004
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default System cannot find file specified - Response.Redir

Hi there,

I have a web app with the following structure

Application
    Folder1
    Folder2
    IncidentReporting
    reports

Inside in the folder IncidentReporting there is an aspx page that uses Response.Redirect to open a crystal report pdf file that is in a folder called reports. This is the code I use:

 Dim ExportPath As String = "../reports"

        Dim rptOrders As New CrystalDecisions.CrystalReports.Engine.ReportDocum ent
        rptOrders.FileName = ExportPath + "DePuy Accident Report.rpt"

        Dim myParameterValues As New ParameterValues()
        Dim myDiscreteValue As New ParameterDiscreteValue()
        myDiscreteValue.Value = CType(GridView1.SelectedValue, Integer)
        myParameterValues.Add(myDiscreteValue)
        rptOrders.DataDefinition.ParameterFields("Accident ID").ApplyCurrentValues(myParameterValues)



        rptOrders.ExportToDisk(ExportFormatType.PortableDo cFormat, ExportPath + Session.SessionID.ToString() + "DePuy Accident Report.pdf")
        Response.Redirect(ExportPath + Session.SessionID.ToString() + "DePuy Accident Report.pdf")



I have tried putting the reports folder in other locations too but i still get the above error.

I would really apprecaite any help on this.

Thanks


 
Old August 16th, 2005, 02:36 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

It looks like you're mixing up local and virtual paths.

What do you get when you debug

ExportPath + Session.SessionID.ToString() + "DePuy Accident Report.pdf

I think when you save to "../reports" it's saved in a sub folder of the Windows folder somewhere, and not a subfolder of your web app.

Look into Server.MapPath to convert virtual paths to physical paths...

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Nowhere Fast by Incubus (Track 2 from the album: Make Yourself) What's This?
 
Old January 26th, 2006, 05:18 AM
Authorized User
 
Join Date: Jun 2004
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar,
Thanks for your reply. I was able to solve this by setting the physical path in the webconfig file and using an application varirable in vb code to access this.








Similar Threads
Thread Thread Starter Forum Replies Last Post
writing into a file in linux file system anboss XSLT 6 June 19th, 2008 01:56 PM
Crystal10 error: system cannot find file specified jnks2005 ASP.NET 1.0 and 1.1 Professional 10 March 9th, 2007 05:36 PM
ASP.net page can't find namespace system.data.orac mel ASP.NET 1.0 and 1.1 Basics 6 December 2nd, 2004 05:24 PM
system don't find vbc.exe file yln BOOK: Beginning ASP.NET 1.0 1 August 2nd, 2004 03:32 PM
Help sending XML file to server, reading response bradartigue XML 1 September 5th, 2003 07:42 AM





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