Hi there. I'm trying to create a button that will create and save my report in Excel and Word files. I can't find any help on how to do it though so I've been trying to figure it out on my own. Can anyone help me figure out how to name the files the program will create when exporting the report. Does anyone know how to set the file names when exporting through code? I'm including my code so you can see what I have so far and offer any advice.
I'd appreciate the help.
CrystalVisualBOracle
'--------- GENERATES AND SAVES ALL CORPORATE REPORTS -------
Private Sub cmdGenCMrpts_Click()
Dim Report As New crptCM_UR_AM
Dim strSelect As String
Report.Database.Tables(1).SetLogOnInfo & _
"DATABEAST", "DATABEAST", "username", "pwd"
strSelect = " {R_CORP_RPT_LOG.DATESTAMP} = "
strSelect = strSelect & "{DATE( '" & strCMCrystalDate & "')"
Report.RecordSelectionFormula = strSelection1
With Report
.ExportOptions.DestinationType = crEDTDiskFile
.ExportOptions.FormatType = crEFTExcel80Tabular
.Export (False)
End With
End Sub
I'd appreciate the help.
CrystalVisualBOracle
'--------- GENERATES AND SAVES ALL CORPORATE REPORTS -------
Private Sub cmdGenCMrpts_Click()
Dim Report As New crptCM_UR_AM
Dim strSelect As String
Report.Database.Tables(1).SetLogOnInfo & _
"DATABEAST", "DATABEAST", "username", "pwd"
strSelect = " {R_CORP_RPT_LOG.DATESTAMP} = "
strSelect = strSelect & "{DATE( '" & strCMCrystalDate & "')"
Report.RecordSelectionFormula = strSelection1
With Report
.ExportOptions.DestinationType = crEDTDiskFile
.ExportOptions.FormatType = crEFTExcel80Tabular
.Export (False)
End With
End Sub