Data Connectivity
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Data Connectivity
Message Icon Topic: exporting CR to pdf with a set path Post Reply Post New Topic
Author Message
moosetracker
Newbie
Newbie


Joined: 31 Jul 2008
Location: United States
Online Status: Offline
Posts: 14
Quote moosetracker Replybullet Topic: exporting CR to pdf with a set path
    Posted: 13 Aug 2008 at 1:29pm
I have tried a few things, but alway get an invalid file path error..
 
I have backed off from my complex path to just get it to store on the c:\
drive rather then some local folder under my username.
 It seems if I ask for any path it get upset...
 
rptname = "testrpt"
strRptPath = "c:\" + rptName

crSet.CrystalRpt.FileName = strRptPath

crSet.CrystalRpt.ExportToDisk(ExportFormatType.PortableDocFormat, rptName)

'crSet.CrystalRpt.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, True, rptName)

Commented out field is where I really want to set the path, so if logic is different in that from my attempt to make it simpler, please let me know..
 
(Oh I did try to put path right on the .export____ --- But they changed als "\" to "_" which really made the path invalid. At least .filename left all the "\" alone.)
 
Any way to get Crystal to let me choose the path???
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 22 Aug 2008 at 11:55am

The ExportToHttpResponse method exports the report to the HTTP Response for the web page so that the document can be displayed.  If you look at the documentation, the type of the second parameter is System.Web.HttpResponse, so you can't give it a path and file name.

The FieldName property is the path and filename of the report that you're opening - it has nothing to do with how the report is exported.
 
-Dell
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.