远程共享服务器上的登录提示-Crystal Report [英] login prompt on remote shared server-Crystal Report

查看:113
本文介绍了远程共享服务器上的登录提示-Crystal Report的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在尝试在共享服务器上部署Crystal Reports 2008.在远程服务器上发布之前,我在将其连接到远程sql server 2008数据库的同时在本地主机上发布了它.该报告显示完整,但是当我在共享服务器上发布该报告时,它提示我输入登录凭据.我的托管服务提供商是arvixe,它支持水晶报表.在我的弹出数据库字段为空且锁定使用名字段中,显示正确的用户名和密码字段为空.我在某处阅读,可能是由于我的版本与服务器上的版本之间的版本冲突所致.预先感谢您的帮助.

我正在使用数据集填充我的数据以进行报告.这是我的源代码:

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;

推荐答案

Helloo ...!

只需在将报告分配给reportviewer之前添加此行即可....!

report.SetDatabaseLogon("yourusername","yourpassword");
Helloo...!

Just Add this line before assigning report to reportviewer....!

report.SetDatabaseLogon("yourusername", "yourpassword");


这篇关于远程共享服务器上的登录提示-Crystal Report的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆