这两件事之间有区别吗?我试图将一些报告从本地服务器移动到开发服务器,我知道我们已经在开发服务器上安装了redist,但是仍然无法运行报告。运行时是否分开我来到不同的网站提到这两件事,但还没有能够告诉他们是否在谈论同样的事情
*编辑 - 发布代码以查看dotjoe是否显示我错误地标记了我的报告路径。数据库连接从一个方法返回到一个字符串数组reportString,这就是那个数组。
<CR:CrystalReportViewer ID="CrystalReportViewer2" runat="server"
AutoDataBind="True" Height="50px" Width="350px" ReuseParameterValuesOnRefresh="True" ToolbarImagesFolderUrl="~/images/reportViwerImages"/>
ConnectionInfo myConnectionInfo = new ConnectionInfo();
myConnectionInfo.ServerName = reportString[1];
myConnectionInfo.DatabaseName = reportString[0];
myConnectionInfo.UserID = reportString[2];
myConnectionInfo.Password = reportString[3];
string ReportPath = Server.MapPath("../../mdReports/CrystalReport.rpt");
CrystalReportViewer2.ReportSource = ReportPath;
ParameterField field1 = new ParameterField();
ParameterDiscreteValue val1 = new ParameterDiscreteValue();
val1.Value = hiddenFieldReportNumber.ToString();
field1.CurrentValues.Add(val1);
SetDBLogonForReport(myConnectionInfo);
private void SetDBLogonForReport(ConnectionInfo myConnectionInfo)
{
TableLogOnInfos myTableLogOnInfos = CrystalReportViewer2.LogOnInfo;
foreach (TableLogOnInfo myTableLogOnInfo in myTableLogOnInfos)
{
myTableLogOnInfo.ConnectionInfo = myConnectionInfo;
}
}