on 05-03-2017 10:33 AM
Hi experts, I'm trying to preview a report using crystal report viewer in Visual Studio. I'm using SAP B1 version for HANA. Below is my code, but I've received Database Vendor Code 328:
Dim cryRpt As ReportDocument
Dim logonProps As NameValuePairs2
cryRpt = New ReportDocument
cryRpt.Load(xPath & "\BIR Reports\APP_GENERAL_LEDGER_orig.rpt")
Dim SAPVersion As String = oCompany.Version.ToString
Dim oUsername As String = oCompany.UserName
Dim oUserid As String = oCompany.UserSignature
cryRpt.SetParameterValue("DateFrom", oDates1 & " 00:00:00")
cryRpt.SetParameterValue("DateTo", oDates2 & " 00:00:00")
cryRpt.SetParameterValue("FROMDATE", oDates1)
cryRpt.SetParameterValue("TODATE", oDates2)
cryRpt.SetParameterValue("SAPVersion", SAPVersion)
cryRpt.SetParameterValue("Username", oUsername)
cryRpt.SetParameterValue("Userid", oUserid)
logonProps = cryRpt.DataSourceConnections(0).LogonProperties
'logonProps.Set("Provider", "HDBODBC32")
'logonProps.Set("Server Type", "HDBODBC32")
logonProps.Set("Connection String", "DRIVER={HDBODBC32};UID=SYSTEM;PWD=P@ssw0rd;SERVERNODE=" & oCompany.Server & ";DATABASE=" & oCompany.CompanyDB & ";")
'logonProps.Set("Locale Identifier", "1033")
cryRpt.DataSourceConnections(0).SetLogonProperties(logonProps)
cryRpt.DataSourceConnections(0).SetConnection(oCompany.Server, oCompany.CompanyDB, "SYSTEM", "P@ssw0rd")
CrystalReportViewer1.EnableRefresh = True
CrystalReportViewer1.ReportSource = cryRpt
CrystalReportViewer1.Refresh()
cryRpt.Close()
cryRpt.Dispose()
User | Count |
---|---|
96 | |
10 | |
9 | |
5 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.