crystal report
-
hello all, i m connecting a crystal report 8.5 thru my vb6 application and i m trying to disaply only specific records in the crystal reports. i m pasing querry in the crystal report thru my VB applcation. all is going well but getting one error at the statement cr.viewreport server has not yet bee opened Private Sub Form_Load() Dim conn As ADODB.Connection Dim rs As ADODB.Recordset Dim crystal As CRAXDRT.Application Dim report As CRAXDRT.report CR.DisplayBorder = False CR.DisplayTabs = False CR.EnableDrillDown = False CR.EnableRefreshButton = False Set conn = New ADODB.Connection conn.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Raj;Data Source=." conn.Open Set rs = New ADODB.Recordset rs.Open "SELECT* From user_file where user_id='Raj'Order By user_id ASC", conn, adOpenStatic, adLockReadOnly Set crystal = New CRAXDRT.Application Set report = crystal.OpenReport(App.Path & "\myrep.rpt") report.DiscardSavedData report.Database.SetDataSource rs CR.ReportSource = report 'here at this statement i m having problem getting erro msg :server has not yet been opened CR.ViewReport CR.Zoom 94 rs.Close Set rs = Nothing conn.Close Set conn = Nothing Set crystal = Nothing Set report = Nothing End Sub sending the code for ur refrence. please help me if anybd can thanks