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

Naming files when exporting reports to Word and Excel using RDC

Status
Not open for further replies.
Jan 8, 2001
163
US
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top