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

Some background. I am designing

Status
Not open for further replies.

fluteplr

Programmer
Oct 23, 2000
1,599
US
Some background.

I am designing a combination crystal report viewer, designer form in Visual Foxpro 7

All the data is on a sql 2000 server. All the reports are using OLEDB to get the data.

In the init code I instanciate the crytal report object as follows depending on whether they can edit/create reports (only admins can)

IF .admin
.ocrApplication = CREATEOBJECT("CrystalDesignRuntime.Application")
ELSE
.pgfRDC.PageCount = 2 && delete edit page
.ocrApplication = CREATEOBJECT("CrystalRuntime.Application")
ENDIF

OK so far so good. Now the problem.

If am using the CrystalRuntime.Application then I can set security as follows (assume the report has already been opened sucessfully and the oreport object points to it.

IF .oReport.Database.Tables.Count > 0
FOR i = 1 TO .oreport.database.tables.count
otable = .oreport.database.tables.item(i)
IF .trusted
otable.SetLogOnInfo( .Server, .Database,'<<Use Integrated Security>>','')
ELSE
otable.SetLogOnInfo( .Server, .Database, .UserID, .Password)
ENDIF
ENDFOR
ENDIF

works great

But

Exactly the same code run wth the crystaldesignruntime and it fails. There is no error, but the logon info is not set, when you preview or open the designer it hangs for a while and then the crystal database login screen shows up with the old data stored in the report.


I have tried using logonserver instead, but I just get the famous 'server not yet opened' error.

Any thoughts? Please note changing the reports to use a data access method other than OLEDB is not really a viable option at this point.

Also please note: ALL the code works perfectly with the crystalRuntime object but not with the crystalResignRuntime object.

For those who are interested the crystalRuntime object is craxdrt.dll the crystalDesignRuntime object is craxddrt.dll (note the 2nd 'd').
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top