on 01-09-2014 2:58 PM
Hi,
I'm trying to use this version CRforVS 13_0_8 to view my report with SAP HANA and i get this error incorrect report source, but i don't know if this version support SAP HANA or is something missing on my code. Here is the code :
ConnectionInfo connectionInfo = new ConnectionInfo();
connectionInfo.ServerName = dbServ;
connectionInfo.DatabaseName = BDCompany;
connectionInfo.UserID = dbUser;
connectionInfo.Password = dbPsw;
the dbServr is the servername and the port. And I try this to
ConnectionInfo connectionInfo = new ConnectionInfo();
string hanaSername = "Driver={HDBODBC32};ServerNode=" + dbServ + ";";
connectionInfo.ServerName = hanaSername ;
connectionInfo.DatabaseName = BDCompany;
connectionInfo.UserID = dbUser;
connectionInfo.Password = dbPsw;
Greetings.
Hi Williams,
Unfortunately the HANA ODBC driver is not shipped with CR for Visual Studio.
I did quick test and the report does open but if I try to refresh if fails because I don't have the Hana ODBC driver which gets install with the Hana Suite.
I doubt you'll be able to set a new HANA server so just try setting the User Name and PW.
And/Or change the DB driver to crdb_odbc.dll
It may work if Hana Suite or Client and CR for VS is on the same PC....
Bottom line is it's not supported, but it may work. See the Platforms link on the Overview tab for supported DB clients.
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
I did a quick test and this works for me now. I had to have the Hana client installed but this will work for the main report, you need to search for subreport and set the log on info for them also if used.
private void SetLogonInfo_Click(object sender, EventArgs e)
{
CrystalDecisions.CrystalReports.Engine.ReportObjects crReportObjects;
CrystalDecisions.CrystalReports.Engine.SubreportObject crSubreportObject;
CrystalDecisions.CrystalReports.Engine.ReportDocument crSubreportDocument;
CrystalDecisions.CrystalReports.Engine.Database crDatabase;
CrystalDecisions.CrystalReports.Engine.Tables crTables;
TableLogOnInfo crTableLogOnInfo;
CrystalDecisions.Shared.ConnectionInfo crConnectioninfo = new CrystalDecisions.Shared.ConnectionInfo();
//set up the database and tables objects to refer to the current report
crDatabase = rpt.Database;
crTables = crDatabase.Tables;
bool mainSecureDB;
//loop through all the tables and pass in the connection info
foreach (CrystalDecisions.CrystalReports.Engine.Table crTable in crTables)
{
mainSecureDB = rpt.Database.Tables[tableIndex].LogOnInfo.ConnectionInfo.IntegratedSecurity;
string mainTableName = crTable.Name.ToString();
tableIndex++;
//pass the necessary parameters to the connectionInfo object
crConnectioninfo.ServerName = "Hana"; // Your DSN
if (!mainSecureDB)
{
crConnectioninfo.UserID = "YourUserName";
crConnectioninfo.Password = "YouPassword";
crConnectioninfo.DatabaseName = "XTREME.CUSTOMER"; // Your DB and table
}
else
crConnectioninfo.IntegratedSecurity = true;
crTableLogOnInfo = crTable.LogOnInfo;
crTableLogOnInfo.ConnectionInfo = crConnectioninfo;
crTable.ApplyLogOnInfo(crTableLogOnInfo);
}
So this works with ODBC but requires the Hana ODBC driver to be installed, I did not test using the JDBC driver.
Also, you don't need to specify the driver name. And I did not test this going to a different Hana server, not sure if the ReplaceConnection API will work.
PS - code is not complete
Thanks
Don
hi Williams,
here's where you can download the hana client which includes the 32 bit driver as well if you didn't already download that. you'll need the win86 32 bit download on the client tab.
cheers,
jamie
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.