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

CRViewer1.Refresh Doesn't Work

Status
Not open for further replies.

vbneil54

Programmer
Sep 11, 2001
14
US
When I try the Refresh it says "Server not yet opened"
What can I do??
 
You're not successfully connecting to the database. Are you using .LogonServer or .SetLogonInfo? And what parameters are you passing?
 
I'm trying to conect to the server but keep runing into connection string problems. Could you please show me a working
report.database.logonserverex "p2soledb.dll", TheReportName, "", "", "", "ole db", cn

cn is "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\ah.mdb;Persist Security Info=False"
thanks
 
Okay, it's an Access database. You don't need to logon to the server.

If you picked OLEDB - Microsoft Jet OLEDB 4.0 at the beginning of building your report, it's just a couple of lines:

Set App = New CRAXDRT.Application
Set Report = App.OpenReport("CrystalDir\my.rpt")
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
 
Ok,
That worked. Thank you.
But now when I hit the refresh button it goes back to the same error, server not yet open.
 
I can't get it to re-read the data after the first time i open it.
 
It doesn't happen for me.

Is there any VB code after .ViewReport that would mess things up like deleting the app object?
 
here is the code...

Private Sub Form_Load()

Screen.MousePointer = vbHourglass
Set app1 = New CRAXDRT.Application
Set Report = app1.OpenReport(TheReportName)
CRViewer1.EnableGroupTree = False
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
Screen.MousePointer = vbDefault

End Sub
 
here is the error msg...
Method 'Refresh' of object 'ICrystalReportViewer3' Failed
 
all of this code is in the form that holds the CRviewer

Dim app1 As New CRAXDRT.Application


Private Sub Form_Load()
Screen.MousePointer = vbHourglass
Set app1 = New CRAXDRT.Application
Set Report = app1.OpenReport(TheReportName)
CRViewer1.EnableGroupTree = False
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
Screen.MousePointer = vbDefault

End Sub

Private Sub Form_Resize()
CRViewer1.Top = 0
CRViewer1.Left = 0
CRViewer1.Height = ScaleHeight
CRViewer1.Width = ScaleWidth

End Sub

I have no code in the viewer it self.
 
Sorry, I can't duplicate the error.

What's interesting is that your viewer object is called CRViewer1 but the error message says the error is on object ICrystalReportViewer3. Don't understand that.
 
Thanks for your help. I'm going to try to re-install crystal and see if that helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top