Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Deployed Application has Blank WPF Viewer

VS2010

CR_13_1_0

WPF Viewer

.Net 4.0

I have an issue where the reports I create in development enviroment work fine on integrated or non integrated connection, however when I deploy the application to the production machine, the WPF asks for Login Information

The servername, Username are correct, however the Database name is blank and I am unable to edit it in the login box. This is not the case on the development environment , even when I purposely put wrong login details (username) the database name is present.

Help Please

the code below is what is done before opening the report.

Prerequistes

.Net Framework 4.0 -- NOT CLIENT

.Net 2.0 sp2

MDAC 2.8

SAP Crystal Reports Runtime Engine for .Net Framework 4.0

private ReportClass LoadReport(ReportClass objRpt)
        {
            objRpt = new ReportName();
            objRpt = ConfigureReport(objRpt);
            this.vwCrystalReportViewer.ViewerCore.ReportSource = objRpt;
            return objRpt;
        }
   private ReportClass ConfigureReport(ReportClass objRpt)
        {
            try{
            objRpt.Load();
            ConnectDatabase(ref objRpt);
            objRpt.VerifyDatabase();
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }

            return objRpt;
        }
        private void ConnectDatabase(ref ReportClass objRpt)
        {
            bool UseParams = CommonCode.GetParamValueBool("ReportingUseParams");
            ConnectionInfo connectionInfo = new ConnectionInfo();
            connectionInfo.AllowCustomConnection = true;
            bool IsTrusted;
            if (UseParams == true)
            {
                IsTrusted = CommonCode.GetParamValueBool("ReportingIsIntegrated");


                if (IsTrusted == true)
                {
                    connectionInfo.UserID = "";
                    connectionInfo.Password = "";
                }
                else 
                {
                    connectionInfo.UserID = CommonCode.GetParamValue("ReportingUsername");
                    connectionInfo.Password = CommonCode.GetParamValue("ReportingPassword");
                }
            }
            else
            {
                IsTrusted = CommonCode.dbTrusted;


                if (IsTrusted == true)
                {
                    connectionInfo.UserID = "";
                    connectionInfo.Password = "";
                }
                else
                {
                    connectionInfo.UserID = CommonCode.dbUsername;
                    connectionInfo.Password = CommonCode.dbPassword;
                }
            }


            connectionInfo.DatabaseName = CommonCode.dbDatabaseName;
            connectionInfo.ServerName = CommonCode.dbServer;
            connectionInfo.IntegratedSecurity = IsTrusted;

            SetDBLogonForReport(connectionInfo, objRpt);

        }

     
        private void SetDBLogonForReport(ConnectionInfo connectionInfo, ReportDocument reportDocument)
        {
            Tables tables = reportDocument.Database.Tables;

            foreach (CrystalDecisions.CrystalReports.Engine.Table table in tables)
            {
                try
                {
                    TableLogOnInfo tableLogonInfo = table.LogOnInfo;
                   tableLogonInfo.ConnectionInfo = connectionInfo;
                    tableLogonInfo.ConnectionInfo.IntegratedSecurity = connectionInfo.IntegratedSecurity;
                    table.ApplyLogOnInfo(tableLogonInfo);
                }
                catch (Exception e)
                {
                    System.Windows.Forms.MessageBox.Show(e.Message);
                }
            }
        }

Edited by: sumptert on Jun 15, 2011 3:41 AM

Edited by: sumptert on Jun 15, 2011 6:26 AM

Former Member
replied

Make sure you installed SP 1 runtime on the client:

MSM

http://downloads.businessobjects.com/akdlm/cr4vs2010/CRforVS_mergemodules_13_0_1.zip

MSI 32 bit

http://downloads.businessobjects.com/akdlm/cr4vs2010/CRforVS_redist_install_32bit_13_0_1.zip

MSI 64 bit

http://downloads.businessobjects.com/akdlm/cr4vs2010/CRforVS_redist_install_64bit_13_0_1.zip

What OS? 32 or 64 bit?

Is your app 32 or 64 bit?

What database?

How are you connecting to the DB (OLE DB, ODBC, etc)?

Is the DB client installed on that computer? And is it correct \ same version as what is on your dev computer?

A simple test; comment out all logon code. Compile. Try this app on the client. The report should prompt for DB logon if needed. Or not, if the correct trusted connection has been created.

Ludek

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

Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question