Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Server has not yet been opened" error when exporting to PDF using VB

Status
Not open for further replies.

MPBCHM

IS-IT--Management
Feb 6, 2002
20
0
0
US
I am trying to automatically export a report to PDF from a function/macro in Access 2000.

When I run the following code I get this error message:

"Server has not yet been opened."

When I click "Debug" the program hi-lights the last line of my code: rep.Export False

CODE:

Public Function ExportToPDF()
Dim appl As New CRAXDRT.Application
Dim rep As CRAXDRT.Report

Set rep = appl.OpenReport("\\File-Server\MyReport.rpt", 1)

rep.ExportOptions.DiskFileName = "\\Outfile\MyReport.pdf"
rep.ExportOptions.DestinationType = crEDTDiskFile
rep.ExportOptions.FormatType = crEFTPortableDocFormat
rep.Export False

End Function

Do I need another line of code that makes the connection to the server or is there something I need to change on the report that will make the connection to the server at runtime?

ANY HELP WILL BE GREATLY APPRECIATED...

Thanks.

Mark
 
I was getting the same error from the various samples I downloaded from crystal and here's what I found:

Try looking for some hotfixes for PDF files. I tried it before and some gave the same error "server has not ..." others just don't create any PDF file. I exported mine to Word - no problemo.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top