Crystal Reports - “您请求的报告需要更多信息" [英] Crystal Reports - "The report you requested requires further information"
问题描述
我有一些使用 Crystal(Visual Studio 外部)创建的 Crystal Reports,现在已加载到 VS 项目中.在预览报表之前,我在报表和所有子报表中设置了这样的报表数据库信息.
I have some Crystal Reports that were created using Crystal (external to Visual Studio) and are now loaded in the VS project. Before the report is previewed I set up the report database information like this in the report and all subreports.
var connectionInfo = new ConnectionInfo();
connectionInfo.ServerName = "192.168.x.xxx";
connectionInfo.DatabaseName = "xxxx";
connectionInfo.Password = "xxxx";
connectionInfo.UserID = "xxxx";
connectionInfo.Type = ConnectionInfoType.SQL;
connectionInfo.IntegratedSecurity = false;
TableLogOnInfo logon = table.LogOnInfo;
table.LogOnInfo.ConnectionInfo = connectionInfo;
table.ApplyLogOnInfo(logon);
报表在最初预览时正确显示,但当我转到报表预览的下一页时,我收到消息您请求的报表需要更多信息",并再次提示输入数据库登录信息.一旦我在这里输入它,我就不再被提示了.我设置的初始 ConnectionInfo 似乎没有超过第一页.
The report displays correctly when it is initially previewed but when I go to the next page in the report preview I get the message, "The report you requested requires further information" and are prompted for the database login information again. Once I have entered it here I am no longer prompted. It appears that the initial ConnectionInfo I set up is not sticking past the first page.
我正在使用 Crystal XI 和 Visual Studio 2008.
I am using Crystal XI and Visual Studio 2008.
推荐答案
我发现修复错误的最佳方法是将问题发布到 StackOverflow 并在 5 分钟后自己解决.不用说,我解决了这个问题.
I have found the best way to fix a bug is to post the question to StackOverflow and 5 minutes later work it out yourself. Needless to say, I worked this out.
除了在报表对象中设置所有登录信息外,我还必须在 ASP.NET 的 Crystal Viewer 组件中进行设置.所以我只是写了一些这样的代码,一切正常,没有提示.
As well as setting all the log on info in the report objects, I also have to do it in the Crystal Viewer component in ASP.NET. So I just write some code like this and it all works, no prompts.
<CR:CrystalReportViewer Height="500px" ID="Viewer" runat="server" />
var connectionInfo = new ConnectionInfo();
connectionInfo.ServerName = "192.168.x.xxx";
connectionInfo.DatabaseName = "xxxx";
connectionInfo.Password = "xxxx";
connectionInfo.UserID = "xxxx";
connectionInfo.Type = ConnectionInfoType.SQL;
connectionInfo.IntegratedSecurity = false;
for (int i = 0; i < Viewer.LogOnInfo.Count; i++)
{
Viewer.LogOnInfo[i].ConnectionInfo = connectionInfo;
}
这篇关于Crystal Reports - “您请求的报告需要更多信息"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!