|
-
Feb 8th, 2005, 01:39 AM
#1
Thread Starter
New Member
Export crystal report + oracle database in VB
I create one standard exe file.
Then I add in a crystal report file with
oracle ODBC connection named as CrystalReport1
Together I add a crystal report viewer.
When I run the program, I got this error
"Server has not yet been opened"
This is the command to export the report out to pdf.
Private Sub Command1_Click()
Dim Report As New CrystalReport1
filedb = App.Path
With Report
.ExportOptions.ODBCDataSourceName = "DSNname"
.ExportOptions.ODBCDataSourceUserID = "Username"
.ExportOptions.ODBCDataSourcePassword = "Password"
.ExportOptions.FormatType = crEFTPortableDocFormat
.ExportOptions.DestinationType = crEDTDiskFile
.ExportOptions.DiskFileName = filedb & "VehicleExp.pdf"
.Export False
End With
End Sub
---------------------------------------
anybody please help me to solve this problem..
thanks
-
Feb 8th, 2005, 12:09 PM
#2
Re: Export crystal report + oracle database in VB
Welcome to the Forums.
"Server has not yet been opened" error usually meand that you havent
properly opened the report with the correct credientials. Try checking out
the Report.Database.Tables(1).SetLogOnInfo sServer, sDatabase, sUserName,
sUserPwd before you open yuor report.
Also, here is a link to one of my examples for using an ADO rs with the CR
Viewer Control.
HTH
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Feb 15th, 2005, 08:15 PM
#3
Thread Starter
New Member
Re: Export crystal report + oracle database in VB
I still having a problem if using the above solution because my report are
using Oracle Database.
Now im using CrystalReport object to export and it was OK.
Below is my code. Just one problem, when i export to RTF, how to bypass dialog box that ask for the Page Range? I want it to export all page.
Private Sub RouteWOAgingReport()
dtFrom = "01/" & strMth & "/" & strYear
dtTo = "23/" & strMth & "/" & strYear
With rptReport
.Connect = "DSN=PROD;UID=Username;PWD=Password;"
.ReportFileName = App.Path & "\" & "rptRouteWOAging.rpt"
.ParameterFields(0) = "DateFrom;" & dtFrom & ";true;"
.ParameterFields(1) = "DateTo;" & dtTo & ";true;"
.ParameterFields(2) = "UnitOffice;" & strUnitOffice & ";true"
.PrintFileType = crptRTF
.PrintFileName = Filedb & "\" & "Route WO Aging.rtf"
.Destination = crptToFile
.ProgressDialog = False
.PrintReport
End With
strReportName = "Route WO Aging.xls"
SendEmail (strReportName)
End Sub
Last edited by g--mey; Feb 15th, 2005 at 08:26 PM.
-
Feb 21st, 2005, 02:40 AM
#4
Thread Starter
New Member
Re: Export crystal report + oracle database in VB
Bump...
somebody please help..
thanks..
-
Feb 21st, 2005, 12:42 PM
#5
Re: Export crystal report + oracle database in VB
Here is one of my examples on export CR. You need to add the reference for exporting and use the .ExportOptions object.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|