
Crystal Report Developer 8.5
Got it sussed now. Yes I am using OLEDB. There seems to be a bug in it or
Crystal. This is what you need to do.
Dim Obj As New Application
Dim Rpt As Report
Set Rpt = Obj.OpenReport("C:\Creditors.RPT")
Rpt.Database.Tables(1).SetLogOnInfo Server, "OJSales", "Reports",
"Reports"
CRViewer1.ReportSource = Rpt
CRViewer1.ViewReport
Note this only works if you reference "Crystal Reports 8.5 ActiveX Designer
Run Time Library". Not the Design and Run Time version.
Thanks for the help.
Ian
Quote:
> On Sat, 22 Jun 2002 11:11:51 +0100, "Ian Hutcheson"
> comp.lang.basic.visual.database:
> Your using OLEDB for connections right? If you are try creating a ODBC
DSN
> and using that in the report to connect. I had the same problem at a
> clients once and that seemed to fix it.
> William
> >Thanks, but I still have problems!
> >> On Thu, 20 Jun 2002 20:52:57 +0100, "Ian Hutcheson"
> >> comp.lang.basic.visual.database:
> >> >Can anyone help me with a couple of problems with Crystal Reports
> >Developer:
> >> >a) "LogOnServer". What is the first parameter for?
> >> Sorry I have never used this method
> > OK, Found this out now, it is the DLL File Name to USE!?! How I can
log
> >on with this is a different story!
> >> >b) How can I load and View a Report at runtime?
> >> Reference the Crystal Reports ActiveX Designer Run Time Library
> >> and Add the Crystal Reports Viewer Control to a form.
> >> With the Designer Run Time you can use the Application object to call
the
> >> OpenReport method then you call the ReadRecords method. If you have
any
> >> parameters you can call the
> >> ParameterFields(indexofparameter).AddCurrentValue method to populate
them.
> >> Then when this is done you can set the ReportSource property to the
> >> Application Object you created to open the report and then call the
> >> ViewReport Method.
> > Tried this and in principle it works. I am using a SQL Server that
> >requires a password and now I keep getting "Server Not Opened" Errors.
Can
> >anyone advise how to overcome this. I cannot use logonserver as the
error
> >occures here too???
> >> William
> >> >Thanks