dayiku
asked on
Open Crystal reports file with Visual Basic application
Hi,
I have created a crystal reports file for my users. I want them to be able to click on an executable and be able to open up the file withou worrying about the login or the server name.
I setup a dsn on their pc so everything should be transparent.
This the code i have now
Set Report = Appl.OpenReport("c:\crysta l_file.rpt ")
Report.Database.LogOnServe r "p2sodbc.dll", "DatabaseName", "DatabaseName", "username", "password"
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
I get a "Server has not yet been opened" error message from crystal reports.
Can anybody help me to get this to work?
I have created a crystal reports file for my users. I want them to be able to click on an executable and be able to open up the file withou worrying about the login or the server name.
I setup a dsn on their pc so everything should be transparent.
This the code i have now
Set Report = Appl.OpenReport("c:\crysta
Report.Database.LogOnServe
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
I get a "Server has not yet been opened" error message from crystal reports.
Can anybody help me to get this to work?
ASKER
I tried it on my pc and it doesn't work. Do you know why?
I need to get it to work on my pc before i give it to the client.
I need to get it to work on my pc before i give it to the client.
Check out the windows\crystal folder to see if the above dlls are there/
ASKER
I found the dll in the system folder. Should i put it in the crystal folder?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This is what i found on the crystal decision website.
Crystal 8 has a know problem with visual basic.
To work around this issue, use the 'SetLogonInfo' method off the 'Tables' object rather than the 'LogonServer' method. For example:
'Sample Code for SetLogonInfo
Report.Database.Tables(1). SetLogOnIn fo "server", "database", "UID", "PWD"
Crystal 8 has a know problem with visual basic.
To work around this issue, use the 'SetLogonInfo' method off the 'Tables' object rather than the 'LogonServer' method. For example:
'Sample Code for SetLogonInfo
Report.Database.Tables(1).
Check out the client PC and ensure that you have the p2sodbc.dll. Or ensure that you have the crystal runtime on the client PC.