CrazyManiac
MIS
I've made some reports, they connect to MSSQL Server trough OLEDB/ADO. Reports are viewed from LotusNotes Application. Everything works fine , but when I try to connect to other database (with the same structure) on the same server or on other server report takes data from olddatabase. How can I change report datasource from VBscript (I use CR9, option 'Save data wth report' switched off)? Here's the example of my VBScript:
Sub Postopen(Source As Notesuidocument)
Dim Viewer As Variant
Set Viewer = Source.getObject( "Crystal Report Viewer Control 9" )
Dim App As Variant
Set App = createObject ("CrystalRuntime.Application" )
Dim Rep As Variant
Set Rep = App.openReport( "C:\Temp\aaa.rpt" )
Rep.Database.tables(1).setLogOnInfo SERVER, DatabaseName,username,password
Set Viewer.reportSource = Rep
Viewer.viewReport
End Sub
Sub Postopen(Source As Notesuidocument)
Dim Viewer As Variant
Set Viewer = Source.getObject( "Crystal Report Viewer Control 9" )
Dim App As Variant
Set App = createObject ("CrystalRuntime.Application" )
Dim Rep As Variant
Set Rep = App.openReport( "C:\Temp\aaa.rpt" )
Rep.Database.tables(1).setLogOnInfo SERVER, DatabaseName,username,password
Set Viewer.reportSource = Rep
Viewer.viewReport
End Sub