Crystal Reports Excel Format Option Problem
Hi guys, I am developing an application where i am using vb6 and crystal reports. Crystal reports has this export functionality to any format particularly excel. Can somebody help me if i could set the default excel format options and not showing the dialog box to the user? I only want them to see the 'save as' dialog box for excel file. Thank you in advance
Re: Crystal Reports Excel Format Option Problem
Re: Crystal Reports Excel Format Option Problem
Post Crystal Reports version and how are You calling the Crystal Reports engine in VB ( OCX or RDC or API ? )
But , yes, it can be solve with VB code...
Re: Crystal Reports Excel Format Option Problem
Hi, Thanks for replying. I am using Crystal Report version 10. In my VB code, i used CrystalActiveXReportViewer. This is my code to generate the report:
Dim oApp As CRAXDRT.Application
Dim oReport As CRAXDRT.Report
Dim oRs As New ADODB.Recordset
oRs.Open "myTable", ConnectionManager.DBConnection, adOpenForwardOnly, adLockReadOnly, adCmdTable
Set oApp = New CRAXDRT.Application
Set oReport = oApp.OpenReport(strReportPath & "\myReport.rpt", 1)
oReport.Database.SetDataSource oRs, 3, 1
crvMyCRViewer.ReportSource = oReport
crvMyCRViewer.ViewReport
Thanks...
Re: Crystal Reports Excel Format Option Problem
Try a little with :
Code:
With oReport.ExportOptions
.DestinationType = crEDTApplication
.FormatType = crEFTExcel97
.DiskFileName = "SomeFileName.xls"
End With
oReport.Export False
It's not neccesary to preview the report.
There are more properties, methods and events related inside .ExportOptions
Good luck
JG