Skip to Content
0
Former Member
Feb 22, 2011 at 06:25 AM

login prompt on remote shared server-Crystal Report

77 Views

HI

I am trying to deploy crystal reports 2008 on shared server. Before publishing on the remote server i published it on the localhost while connecting it to remote sql server 2008 database. The report is shown perfactly but when i publish it on shared server it prompt me for login credentials. My hosting provider is arvixe and it support crystal report. In my popup database field is empty and locked use name field show the correct user name and password field is empty. I read somewhere it may be due to version conflict between my version and version on server. Thanks in advance for help

I am using dataset to puch my data to report. Here is my source code

myRpt report = new myRpt();
            crConnectionInfo.ServerName = @"mysharedserver.com";
            crConnectionInfo.DatabaseName = "mydb";
            crConnectionInfo.UserID = "myuser";
            crConnectionInfo.Password = "mypass";
                        
            System.Data.SqlClient.SqlConnection myConnection = new System.Data.SqlClient.SqlConnection();
            myConnection.ConnectionString = "Data Source=mysharedserver.com;Initial Catalog=mydb;Persist Security Info=True;User ID=myuser;Password=mypass";
            
            System.Data.SqlClient.SqlCommand MyCommand = new System.Data.SqlClient.SqlCommand("dbo.spspMyStoreProc");
            MyCommand.Connection = myConnection;
            MyCommand.Parameters.Add("@PositionID", SqlDbType.Int).Value = (cmbPositions.SelectedValue == "" ? 0 : Convert.ToInt32(cmbPositions.SelectedValue));
            MyCommand.CommandType = System.Data.CommandType.StoredProcedure;
            System.Data.SqlClient.SqlDataAdapter MyDA = new System.Data.SqlClient.SqlDataAdapter();
            MyDA.SelectCommand = MyCommand;
            myDS _DS = new myDS();
            MyDA.Fill(_DS, "dbo.spspMyStoreProc");            
            report.SetDataSource(_DS);


            crDatabase = report.Database;
            crTables = crDatabase.Tables;
            for (int i = 0; i < crTables.Count; i++)
            {
                crTable = crTables<i>;
                crTableLogOnInfo = crTable.LogOnInfo;
                crTableLogOnInfo.ConnectionInfo = crConnectionInfo;
                crTable.ApplyLogOnInfo(crTableLogOnInfo);

            }

            report.SetParameterValue(0, "Param 1");
            report.SetParameterValue(1, "Param 2");
            report.SetParameterValue(2, "Param 3");
            report.SetParameterValue(3, (cmbPositions.SelectedValue == "" ? 0 : Convert.ToInt32(cmbPositions.SelectedValue)));
            CrystalReportViewer1.ReportSource = report;