cancel
Showing results for 
Search instead for 
Did you mean: 

Deployed Application has Blank WPF Viewer

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

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]

Former Member
0 Kudos

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

I had to create a new copy of the database (development environment) on the same SQL server version as the client, set the database location to the new database, recompile then publish to production - whola it worked!!

Is there any way to do this in code? so that if another client has a different version of SQL Server, I dont have to recompile/reissue a separate copy

Edited by: sumptert on Jun 16, 2011 8:30 AM

Edited by: sumptert on Jun 16, 2011 8:34 AM

former_member183750
Active Contributor
0 Kudos

You should not need to go to all that work. All I can give is some resources to have a look at:

[Troubleshooting Guide to Database Connectivity Issues with Crystal Reports in Visual Studio .NET Applications|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/b0225775-88c4-2c10-bd80-8298769293de]

[Using Integrated and SQL Authentication in .NET Applications|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b021e47e-be1d-2b10-c6b2-efa9db3abd6b]

Samples:

http://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsfor.NETSDK+Samples

KBases and nore can be searchd for using hte search box in the top right corner of this web page.

And of course, dev help files;

[Report Application Server .NET API Guide|http://help.sap.com/businessobject/product_guides/sapCRVS2010/en/xi4_rassdk_net_api_en.zip]

[Report Application Server .NET SDK Developer Guide|http://help.sap.com/businessobject/product_guides/sapCRVS2010/en/xi4_rassdk_net_dg_en.zip]

[SAP Crystal Reports .NET API Guide|http://help.sap.com/businessobject/product_guides/sapCRVS2010/en/crnet_api_2010_en.zip]

[SAP Crystal Reports .NET SDK Developer Guide|http://help.sap.com/businessobject/product_guides/sapCRVS2010/en/crnet_dg_2010_en.zip]

- Ludek

|

Answers (0)