Mike,
Just to give you an idea of what I'm trying to say here is my code.
I have 2 forms the first one is the form where in I have
to select what report to preview.
option button:
Report 1 -->> "F:\Acctapps\Report\SI_BOOK.Rpt"
Report 2 -->> "F:\Acctapps\Report\CSI_BOOK.Rpt"
Report 3 -->> "F:\Acctapps\Report\BDN_BOOK.Rpt"
Report 4 -->> "F:\Acctapps\Report\BCN_BOOK.Rpt"
---cmdView.Click
Do Case
Case Option1.Value = 1
DO FORM f:\acctapps\gl_001\h_gl\f_crystal WITH "f:\ACCTAPPS\REPORT\SI_BOOK.RPT"
Case Option2.Value = 2
DO FORM f:\acctapps\gl_001\h_gl\f_crystal WITH "f:\ACCTAPPS\REPORT\CSI_BOOK.RPT"
...
Endcase
My second form is for viewing the report.
--Init
LPARAMETERS tcReport
LOCAL oCrystal as CRAXDRT.Application
LOCAL oReport as CRAXDRT.Report
WITH This
.WindowState = 2
oCrystal = CREATEOBJECT("Crystalruntime.Application"

oReport = oCrystal.OpenReport(tcreport)
WITH .oleCRViewer
.EnableExportbutton = .t.
.EnableProgressControl = .t.
.ReportSource = oReport
.EnableAnimationCtrl = .f.
.ViewReport()
ENDWITH
ENDWITH
--Activate
WITH this.oleCRViewer
.top = 1
.left = 1
.height = thisform.Height - 2
.width = thisform.Width - 2
ENDWITH
--Error
LPARAMETERS nError, cMethod, nLine
IF nerror !=1440
DODEFAULT()
ENDIF
--Resize
WITH This.OleCRViewer
.top =1
.left =1
.height =this.Height - 2
.width =this.Width - 2
ENDWITH
When I run the report I come up with an error:
Logon failed.
Details:[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'USER'
I tried to add this code but same problem
oCrystal.LogOnServer("p2ssql.dll","FINANCE","HPI_GL","user","grant"
thanks
triplex