cancel
Showing results for 
Search instead for 
Did you mean: 

CRVS2010 Beta - Report Table ConectionInfo Not Updated on x64 version.

Former Member
0 Kudos

I have converted an existing app to use the new CR for VS2010, when I test the app on a x32 platform all seems well, however, using the same code on an x64 platform results in a "logon failed" error.

Below is the code I am using, basically copied from SAP website.


private class ApplyCrLogin
        {
            public ApplyCrLogin()
            {
                DbName = "";
                ServerName = "";
                UserId = "";
                PassWord = "";
            }

            public string DbName { private get; set; }
            public string ServerName { private get; set; }
            public string UserId { private get; set; }
            public string PassWord { private get; set; }
    
            public void ApplyInfo(ref ReportDocument rpt)
            {
                try
                {
                    var boConnectionInfo = new ConnectionInfo
                                                          {
                                                              ServerName = ServerName,
                                                              DatabaseName = DbName,
                                                              UserID = UserId,
                                                              Password = PassWord
                                                          };


                    // Modify the ConnectionInfo for all tables in the main report        
                    ModifyConnectionInfo(rpt.Database, boConnectionInfo);

                    // Modify the ConnectionInfo for all tables in all subreports
                    foreach (ReportDocument boSubreport in rpt.Subreports)
                    {
                        ModifyConnectionInfo(boSubreport.Database, boConnectionInfo);
                    }
                }
                catch (Exception error)
                {
                    ExceptionHandling.LogProblem(error);
                }
            }

            private static void ModifyConnectionInfo(Database boDatabase, ConnectionInfo boConnectionInfo)
            {
                // Loop through each Table in the Database and apply the changes
                foreach (Table boTable in boDatabase.Tables)
                {
                    var boTableLogOnInfo = (TableLogOnInfo)boTable.LogOnInfo.Clone();
                    boTableLogOnInfo.ConnectionInfo = boConnectionInfo;

                    boTable.ApplyLogOnInfo(boTableLogOnInfo);
                }
            }
        }

When I check the properties of the report, they do not change from the original set in the report design.

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Final Production release is now available. See this thread for more info:

Answers (1)

Answers (1)

former_member183750
Active Contributor
0 Kudos

Are you using the 64 bit CR runtime or 32 bit? If 64 bit, is the DB client / connection 64 bit? E.g.; if you are using ODBC, did you create a 64 bit ODBC connection?

How did you install the CR 64 bit runtime?

Ludek

Follow us on Twitter http://twitter.com/SAPCRNetSup

Former Member
0 Kudos

Many thanks for your reply. The order that I installed things is as follows, firstly I installed the 64bit SQL Client, as downloaded from the Microsoft Website, then I installed the CRVS2010 installer from the SAP website. This gave the the problems above, as at this point I installed the x64 CR runtime in case that was needed also, this made no difference, the results were the same.

However, following a similar approach on an x86 based system, will all 32bit SQL Client, the CRVS2010, and the x86 CR runtime, all worked as expected.

former_member183750
Active Contributor
0 Kudos

If the SQL Client is 64 bit, you need 64 bit CR runtime and you need to compile the app as 64 bit. I suspect the reason this works on 32 but is that the app is compiled to run as 32 bit and there is a 32 bit SQL client installed. I am still not sure if you are connecting to the MS SQL via ODBC, OLE DB or (?).

If ODBC and the app is compiled as 32 bit, you must create a 32 bit ODBC datasource. See the KBase [How to create a 32 bit ODBC data source on a 64 bit Operating System|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_dev/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333533303335333633323330%7D.do].

One thing you do not want to do is compile as "any cpu". Compile as either 32 or 64 bit.

Ludek

Former Member
0 Kudos

We use OLEDb, not ODBC. There are no 32bit SQL Client drivers on this computer, only the 64bit was installed.

Why do we have to build against x86 or x64, every other tool we have works fine built against any cpu.

It seems to me that the crystal reports is getting more intolerant with every new release. When I was using XI or 2008, there were always problem with distribution, I could never get the MSM files to work as there were always wrong versions of the c runtime etc. With this connectioninfo option, whilst the website shows an simple piece of coed to use this option, it rarely works as advertised without additional conditions being applied.

I must say I am only moments away from biting the bullet and scraping our crystal reports options in our development projects, and switch to Active Reports or even MS's reporting tools.

former_member183750
Active Contributor
0 Kudos

So, did you even try the suggestion?

Ludek

Former Member
0 Kudos

Honestly, I haven't tried it. The reason being I need to study the full implications of changing our projects to x86 and x64. We have developers that are still using Vista32 and some using Vista64, and they are working on the same projects. This has been my reason for ensuring all projects will build, test and run when set for any cpu.