我创建了一个非常简单的报告,只是为了测试使用ASP.net连接它的方式。它似乎正在加载报告并从数据库中提取报告数据而没有任何问题,但显示的只是一堆垂直线。但是,如果我选择通过工具栏导出为PDF等,那么看起来不错。检查页面的源代码也会显示数据存在。
以下是图片结果:http://i.imgur.com/gyUgNBt.png
这是我的代码:
protected override void OnPreRender(EventArgs e)
{
ReportDocument report = new ReportDocument();
report.Load(@"C:\Users\en\Desktop\Crystal Reports\report1.rpt");
report.SetDatabaseLogon("xxx", "xxx", @"xxx", "xxx");
CrystalReportViewer1.ReportSource = report;
}
在aspx中:
<table>
<tr>
<td>
<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="True" Height="1202px" ReportSourceID="CrystalReportSource1" ToolPanelWidth="200px" Width="903px" DisplayToolbar="False" EnableDatabaseLogonPrompt="False" EnableParameterPrompt="False" />
<CR:CrystalReportSource ID="CrystalReportSource1" runat="server">
<Report FileName="C:\Users\ben\Desktop\Crystal Reports\Report1.rpt">
</Report>
</CR:CrystalReportSource>
</td>
</tr>
</table>
我发现一些文档显示IE是问题,并通过检查并确定它在Chrome中运行良好来确认。它也适用于IE兼容模式。用户将在IE中;有人知道从一开始就让IE正确显示的方法吗?
答案 0 :(得分:1)
我最终开启了IE7仿真模式,如下所示:http://forums.asp.net/t/1472369.aspx/1
这感觉就像是一个糟糕的修复,但似乎工作得很好。