Click to See Complete Forum and Search --> : Crystal Reports Excel Format Option Problem
aris_sy
Nov 25th, 2008, 12:25 AM
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
jggtz
Nov 25th, 2008, 11:46 AM
........
jggtz
Nov 25th, 2008, 11:49 AM
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...
aris_sy
Nov 25th, 2008, 06:34 PM
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...
jggtz
Nov 25th, 2008, 09:12 PM
Try a little with :
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
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.