

Crystal Reports ODBC Connection to SAP HANA DB
source link: https://answers.sap.com/questions/12740556/crystal-reports-odbc-connection-to-sap-hana-db.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Crystal Reports ODBC Connection to SAP HANA DB
Crystal Reports ODBC Connection to SAP HANA DB
i have a problem. When i change the ODBC connection string runtime (Programmatically) i have a problem when the program are in execution using x64 processor architecture. Every time when i going to print or export the report i have a connection error but when the program are in execution using x32 processor architecture the problem can't persist.
My connection string is:
DRIVER=B1CRHPROXY32;SERVERNODE=ServerName:30015;DATABASE=DataBaseName;
The error: "Error to open the report connection".
I use .net SDK whit sap crystal report 2016 and the crystal report integration for sap business one version 9.3 PL 09.
I'm sure that there are a solution.
Thank you and best regards Tommaso.
So I have a c# program that I use the SDK to generate Crystal Reports invoices for
This is just an example of what I do.
This uses a standard SAP B1 Crystal Invoice, passing the Object ID and DocEntry values
Saves a copy of the invoice to a local server/computer
public static void CreateInvoicePDF(int DocEntry, string CardCode, string CustomerName, string InvoiceNo, decimal InvoiceAmount, string WebOrderNo, bool Paid, string CustomerEmail, string ReportPath, string Key) { bool FileFound = false; string InvoicePath; string InvoiceFileName = string.Empty; string SAP_Server = ConfigurationManager.AppSettings["SAP_Server"]; string SAP_DBUID = EncryptProvider.AESDecrypt(ConfigurationManager.AppSettings["SAP_DBUID"], Key); string SAP_DBPass = EncryptProvider.AESDecrypt(ConfigurationManager.AppSettings["SAP_DBPass"], Key); string SAP_DBName = ConfigurationManager.AppSettings["SAP_CompanyDB"]; InvoiceFileName = string.Format("Invoice_{0}", InvoiceNo) + ".pdf"; ReportDocument CRRpt = new ReportDocument(); InvoicePath = string.Concat(ReportPath,"\\PDF-Invoices\\", InvoiceFileName); // Get the Crystal report CRRpt.Load(ReportPath + "\\D4W-Invoice-2.rpt"); string strConnection = string.Format("DRIVER={0};UID={1};PWD={2};SERVERNODE={3};DATABASE={4};", "{B1CRHPROXY32}", SAP_DBUID, SAP_DBPass, SAP_Server, SAP_DBName); NameValuePairs2 logonProps2 = CRRpt.DataSourceConnections[0].LogonProperties; logonProps2.Set("Provider", "B1CRHPROXY32"); logonProps2.Set("Server Type", "B1CRHPROXY32"); logonProps2.Set("Connection String", strConnection); //logonProps2.Set("Locale Identifier", "1033"); CRRpt.DataSourceConnections[0].SetLogonProperties(logonProps2); CRRpt.DataSourceConnections[0].SetConnection(SAP_Server, SAP_DBName, false); CRRpt.SetParameterValue("DocKey@", DocEntry); CRRpt.SetParameterValue("ObjectId@", int.Parse("13")); // Export the report CRRpt.ExportToDisk(ExportFormatType.PortableDocFormat, InvoicePath); CRRpt.Close(); CRRpt.Dispose(); } }
Thanks , that helped a lot.
In case anyone pass by.
Just we faced a connection error while the connection string is OK but the below fixed the issue >>
string strConnection = string.Format("DRIVER={0};UID={1};PWD={2};SERVERNODE={3};DATABASE={4};", "{B1CRHPROXY32}", SAP_DBUID, SAP_DBPass, SAP_Server, SAP_DBName);
NameValuePairs2 logonProps2 = CRRpt.DataSourceConnections[0].LogonProperties;
logonProps2.Set("Provider", "{B1CRHPROXY32}");
logonProps2.Set("Server Type", "{B1CRHPROXY32}");
logonProps2.Set("Connection String", strConnection);
CRRpt.DataSourceConnections.Clear();
CRRpt.DataSourceConnections[0].SetLogonProperties(logonProps2);
CRRpt.DataSourceConnections[0].SetConnection(SAP_Server, SAP_DBName, false);
CRRpt.Refresh();
CRRpt.SetParameterValue("DocKey@", 2161);
CRRpt.SetParameterValue("ObjectId@", int.Parse("13"));
Recommend
-
18
Technical Articles
-
18
Laura Nevin September 1, 2021 1 minute read
-
10
Consuming CDS View Entities Using ODBC-Based Client Tools本文介绍通过基于 ODBC...
-
12
Donald Guo December 8, 2021 2 minute read ...
-
9
Anikesh Jyotishi September 2, 2022 5 minute re...
-
12
Donald Guo December 5, 2022 2 minute read ...
-
10
Michal Golka 5 hours ago SAP Crystal Reports for Enterprise unable to connect to PostgreSQL 7 Views ...
-
9
Installing SAP Crystal Reports 2020 unto toolbox using Visual Studio 2022 ...
-
8
SAP CRYSTAL REPORT 2020 support ODBC DRIVER 18 FOR SQL SERVER?
-
8
Crystal Reports connection to SQL Server database
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK