|
-
Sep 11th, 2002, 05:50 PM
#1
Thread Starter
Member
Error exporting crystal file
I have a routine to export Crystal Reports files to pdf. If I try to set the pdf file name automatically, I receive an error saying that the file is in use by another program. If I hard code the file name, the code works ok. That's the relevant code I am using:
spdffilename = "C:\Docs\MyFile.pdf"
sDestinationOptions.DiskFileName = spdffilename
oexportoptions = pReport.ExportOptions
With oexportoptions
.DestinationOptions = sDestinationOptions
.ExportDestinationType = ExportDestinationType.DiskFile
.ExportFormatType = ExportFormatType.PortableDocFormat
End With
pReport.Export() 'Error occurs here
If I change the first line to:
spdffilename = System.IO.Path.GetFileNameWithoutExtension(pReport.FilePath) & ".pdf"
The code stops working when the export method runs. Can anyone see what is wrong in this line?
Thanks,
Robert
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|