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').
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').