on 11-13-2018 5:28 PM
I have vb code setup to login using the following
Dim objReport As New CrystalDecisions.CrystalReports.Engine.ReportDocument
objReport.Load(reportname)
objReport.SetDatabaseLogon("xxx", "xxx", "xxx", "xx", True)
When we call the report from our ERP system all is fine, when I call it from VB I get the login failed message. If I go change the report from ODBC to OLEDB the VB code works but our ERP system then gets the login failed.
How do I change the driver in VB so I can use the same report from both systems?
FYI, if you are using Business One there is no work around except to manually change the reports data source from one B1 Source to the new B1 source. There is no set of API's in the B1 DB driver that Cr for VS .NET can access.
And likely the cause is the third property of SetDatabaseLogon() is the Server Name, for a report based on ODBC this would be the DSN name you are using in the report and not the IP or SQL Server Name.
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Richard,
You cannot directly change the Database Provider when using a ReportDocument object.
To do this, you will need to use an ISCDReportClientDocument object. You can access this with something like:
Dim rcd as ISCDReportClientDocument
rcd = objReport.ReportClientDocument.
The "rcd" object model will allow you to change the database provider using either the SetTableLocation method or ReplaceConnection method.
There is a utility you can download that will write out the source code needed (in vb and C#) to change the database information. You can find this utility here:
https://launchpad.support.sap.com/#/notes/1553921
Dan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
61 | |
9 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.