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!

Exporting to a Paginated text file with 61 lines.

Status
Not open for further replies.

berwin

Programmer
Apr 9, 2002
4
US
I found a sample VB program at CrystalDcisions.
It seems to do everything I need except import a reort to a
pagintaed text file with 61 lines. The following is the code. In Private Sub cmdExpSil_Click() I am trying to make it import to the paginated text file than the word document. If anyone has any ideas I would appreciate it.
Thanks.
Sincereley, Bill
-----------------------------------------------------------
Dim ReportFileName
Dim CrystalApplication As Application
Dim CrystalReport As Report
Dim CrystalOptions As ExportOptions
Dim Lines As Integer


Private Sub cmdEmail_Click()
If Len(ReportFileName) = 0 Then
MsgBox "Error: First you must choose a Report File Name."
Exit Sub
End If
Set CrystalOptions = CrystalReport.ExportOptions
CrystalOptions.DestinationType = crEDTEMailMAPI
CrystalOptions.MailSubject = "Testing Report Export via Email"
CrystalOptions.MailMessage = "Here is the latest test."
CrystalOptions.MailToList = "Recipient Name"
CrystalOptions.FormatType = crEFTText
Call CrystalReport.Export(False)
End Sub

Private Sub cmdExit_Click()
Unload Me
End Sub

Private Sub cmdExpMan_Click()
If Len(ReportFileName) = 0 Then
MsgBox "Error: First you must choose a Report File Name."
Exit Sub
End If
Call CrystalReport.Export(True)
End Sub

Private Sub cmdExpSil_Click()
If Len(ReportFileName) = 0 Then
MsgBox "Error: First you must choose a Report File Name."
Exit Sub
End If
Set CrystalOptions = CrystalReport.ExportOptions
CrystalOptions.DestinationType = crEDTDiskFile
CrystalOptions.FormatType = crEFTWordForWindows
'CrystalOptions.FormatType = crEFTPaginatedText
' CrystalReport.ExportOptions.NumberOfLinesPerPage = 61
'CrystalOptions.DiskFileName = "C:\TEMP\OLETEST.DOC"
CrystalOptions.DiskFileName = "R:\Scan\Crystal\txthcfa.txt"
Call CrystalReport.Export(False)
End Sub

Private Sub cmdPreview_Click()
If Len(ReportFileName) = 0 Then
MsgBox "Error: First you must choose a Report File Name."
Exit Sub
End If
Call CrystalReport.Preview
End Sub

Private Sub cmdReport_Click()
CommonDialog1.Filter = "Crystal Reports (*.RPT)|*.RPT"
CommonDialog1.ShowOpen
If Len(CommonDialog1.FileName) = 0 Then
Exit Sub
End If
ReportFileName = CommonDialog1.FileName
Set CrystalReport = CrystalApplication.OpenReport(ReportFileName)
End Sub

Private Sub Form_Load()
Set CrystalApplication = CreateObject("Crystal.CRPE.Application")
End Sub

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top