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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Failed to export report

Status
Not open for further replies.

Wallegator

Programmer
Jan 3, 2001
58
0
0
US
Using Crystal 8.0 in a vb 6 application. Attempting to export to a .pdf. Code worked until we moved it from Windows NT server to Windows 2000. All .dll's appear to be registered. "Failed to export report" error is appearing on line oRpt.Export (False). If I change (False) to (True) error reads "Invalid Directory" with any folder I select. Anyone have an idea what has gone wrong? Any ideas on which .dll's I may have missed? This is driving me crazy. Thank you in advance.

If MyType = "Unapproved" Then
Adodc3.Recordset.Requery
Set oConn = CreateObject("ADODB.Connection")
If frmMainMenu.MyLocal = 0 Then
oConn.ConnectionString = "driver={SQL Server};server=devp_sql1;uid=usqlpcard;pwd=tz922;database=pCardDev"
Else
oConn.ConnectionString = "driver={SQL Server};server=D9M7GG21;uid=sa;;database=pCardDev"
End If
oConn.Open
Set oRS = New ADODB.Recordset
LRecCount = Adodc3.Recordset.RecordCount
RecCount = Adodc3.Recordset.RecordCount
RecPosition = 0
LRecPos = 1
Adodc3.Recordset.MoveFirst
If Adodc3.Recordset.EOF Then
Beep
MsgBox "There are no unapproved transactions at this time.", vbInformation, "Nothing to email..."
Exit Sub
End If
If frmMainMenu.MyLocal = 0 Then
MyFileName = "\\devp_sql1\pcard_Reports\pCardUnapprovedUser.pdf"
Else
MyFileName = "c:\databases\visual basic\pcard\pCardUnapprovedUser.pdf"
End If
MyAdd = 0
Label1.Visible = True
Label2.Visible = True
Label3.Visible = True
LRecCount.Visible = True
LRecPos.Visible = True
Do Until Adodc3.Recordset.EOF
oRS.Open ("Select * from tblTransactions WHERE Unapproved=1 And Cardholder='" & frmReports.Cardholder & "'"), oConn
Set oCR = CreateObject("CrystalRuntime.Application")
If frmMainMenu.MyLocal = 0 Then
Set oRpt = oCR.OpenReport("\\devp_sql1\pcard_Reports\pCardUnapprovedUser.rpt")
Else
Set oRpt = oCR.OpenReport("c:\databases\visual basic\pcard\pcardUnapprovedUser.rpt")
End If
oRpt.EnableParameterPrompting = False
Set Database = oRpt.Database
Set Tables = Database.Tables
Set Table1 = Tables.Item(1)
Table1.SetPrivateData 3, oRS
On Error Resume Next
oRpt.ReadRecords
On Error GoTo 0
oRpt.ExportOptions.DestinationType = crEDTDiskFile
If frmMainMenu.MyLocal = 0 Then
MyListFile = "r:\worcester\pcard\List Files\Unapproved_" & frmReports.Cardholder & ".pdf"
On Error Resume Next
Kill MyListFile
On Error GoTo 0
oRpt.ExportOptions.DiskFileName = MyListFile
Else
MyListFile = "c:\databases\Visual Basic\pcard\List Files\Unapproved_" & frmReports.Cardholder & ".pdf"
On Error Resume Next
Kill MyListFile
On Error GoTo 0
oRpt.ExportOptions.DiskFileName = MyListFile
End If
oRpt.ExportOptions.FormatType = crEFTPortableDocFormat
oRpt.Export (False)
Adodc5.Recordset.AddNew
LRecipient = MyRecipient.Text
Lcc = ""
LListDate = Date
LListTime = Time()
LSubject = "Unallocated Procurement Card Transactions"
LAttachment = MyListFile
Adodc5.Recordset.UpdateBatch
RecPosition = RecPosition + 1
LRecPos = LRecPos + 1
Me.Refresh
oRS.Close
Adodc3.Recordset.MoveNext
Loop
Label1.Visible = False
Label2.Visible = False
Label3.Visible = False
LRecCount.Visible = False
LRecPos.Visible = False
Load frmListView
frmListView.Show
Exit Sub
End If
 
Did you include these 4 in your package:

ExportModeller.dll
crtslv.dll
crxf_pdf.dll
crxf_rtf.dll
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top