cancel
Showing results for 
Search instead for 
Did you mean: 

Error trying to view a RPT with SAP HANA

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

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

Former Member
0 Kudos

Hi Don Williams,

    Where can i change the db driver?

Greetings.

0 Kudos

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

JWiseman
Active Contributor
0 Kudos

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

Answers (0)