原帖五十分:http://community.csdn.net/Expert/topic/4871/4871662.xml?temp=.3209041:本地更换数据服务器名称、网页路径全部都测试通过
2:本地更换数据库名称,必须手动更新报表数据源位置
3:本地更改web.config参数,测试正常
4:制作了安装部署文件,在本地干净的Web服务器上安装测试也正常
5:上传到服务器后,安装水晶报表后首先提示密钥无效,重新安装后正常(经验)接下来的错误就是水晶报表登录失败了,我自己在本地开发测试时也常遇到登录失败的问题,按照高手的指点已经解决了,但是这次用尽浑身解数,始终都是冷冰冰的登录失败……
1:文件夹权限已经调成了Everyone可以完全控制,还是登录失败……
2:数据用户确定可以完全访问数据库,存储过程都赋予了EXEC权限,还是登录失败……
3:本地更改数据服务器名称编译后重新传dll,还是登录失败……
4:本地更改报表.rpt文件,重新替换位置后,重新覆盖,还是登录失败……
5:打了网上下的补丁,文件名cr90dbexwin_en.zip,安装后还是登录失败……疯了…………………………………………已经五天了,自己辛辛苦苦做好的,却不能在网上发布正常浏览,何其痛心……
老板说再给一天机会,搞不定怕就要炒鱿鱼了,本职不保……这几天发现了许多疑问:
1:水晶报表采用存储过程作为数据源,是否属于push模式?
2:采用存储过程在设计报表时,只需要设计时输入服务器名等参数后会自动连接打开数据库访问,这些登录参数信息感觉存储在.rpt文件里,始终有着记忆和缓存?
3:开发过程中更换数据库名,原来的报表始终调用的都是以前的数据库的数据,新建的则调用新的数据库,为什么能够互不影响,在一个报表工程里可以同时调用?
4:后来手动将报表源全部替换成了新的数据库,但是后来更换数据服务器名称却只需要修改服务器名参数就可以重新访问,为什么服务器名称参数可以不一样却可以移植?
5:水晶报表登录单靠服务器名称就可以确定在www上的一台数据库机器,准确地找到数据库服务器?重名的服务器会有多少台,但是又为什么可以找到存储过程了,而且可以校验登录用户和登录密码呢?众多疑问…………………………………………
说明:水晶报表开发环境:ASP.NET 1.1 + SQL SERVER 2000 + WINSERVER 2003
水晶报表版本:VS.NET自带9.15版本
采用存储过程作为报表数据源,push模式,已经加了登录参数
万谢各位!进来的帮我顶一顶,懂些的帮我看一看,会些的和我说一说,可以搞定的就拜您赐教了……
附:设计源码
1:web.config
                  <add key="ServerName" value="SERVERNAME"/>
<add key="DataBase" value="db"/>
<add key="UserId" value="sa"/>
<add key="Password" value="pwd"/>2:登陆参数类public class LogOnInfo
{
public static string _strServerName = ConfigurationSettings.AppSettings["ServerName"];
public static string _strDataBase = ConfigurationSettings.AppSettings["DataBase"];
public static string _strUserId = ConfigurationSettings.AppSettings["UserId"];
public static string _strPassword = ConfigurationSettings.AppSettings["Password"]; public LogOnInfo()
{
_strServerName = ConfigurationSettings.AppSettings["ServerName"];
_strDataBase = ConfigurationSettings.AppSettings["DataBase"];
_strUserId = ConfigurationSettings.AppSettings["UserId"];
_strPassword = ConfigurationSettings.AppSettings["Password"];
} public static string ServerName
{
get{return _strServerName;}
} public static string DataBase
{
get{return _strDataBase;}
} public static string UserId
{
get{return _strUserId;}
} public static string Password
{
get{return _strPassword;}
}
}2:设置报表
public static ReportDocument SetReport(string pstrReportPath)
{
TableLogOnInfo logOnInfo = new TableLogOnInfo();
//这里必须事先申明一个ReportDocument对象 Report,同时加载数据报表
ReportDocument Report = new ReportDocument(); string MapPath = System.Web.HttpContext.Current.Server.MapPath('/' + pstrReportPath); if(MapPath == null) return null; Report.Load(MapPath); // 对报表中的每个表依次循环。
for (int i=0;i == Report.Database.Tables.Count - 1;i++)
{
//设置logOnInfo参数
logOnInfo.ConnectionInfo.ServerName = LogOnInfo.ServerName;
logOnInfo.ConnectionInfo.DatabaseName = LogOnInfo.DataBase;
logOnInfo.ConnectionInfo.UserID = LogOnInfo.UserId;
logOnInfo.ConnectionInfo.Password = LogOnInfo.Password; Report.Database.Tables[i].ApplyLogOnInfo (logOnInfo);
} return Report;
}