我有一个运行良好的水晶报告,直到我在 Firefox 中对其进行了测试。它在第一次加载时显示数据/报告,但是当我单击报告过滤器的“开始”按钮时,它会显示空白报告,除非我单击这些按钮中的任何一个 - 放大、缩小、页面/浏览器刷新并输入页码。这只发生在 Firefox 中。Chrome 和 IE 加载它就好了。顺便说一句,我正在使用 site.master 页面。
我尝试了什么:
- 隐藏的报告标题
- 取消选中报告中的“新页面”复选框
- 确保在调试中报告源中有项目。它有特别的。单击刷新时,它会再次显示报告。另外,我将空白报告导出到excel,它确实有数据
可能是什么原因造成的?有什么建议吗?
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
<asp:Panel ScrollBars="Auto" runat="server">
<asp:UpdatePanel ID="updatePnl" runat="server" UpdateMode="Always" ChildrenAsTriggers="true" >
<ContentTemplate>
<asp:ValidationSummary ID="ValidationSummary1" runat="server" ValidationGroup="all" />
<table border="0" cellspacing="0" cellpadding="0">
<tr align="left" valign="middle">
<td class="font_01">
From Date:
</td>
<td>
<asp:CustomValidator ID="cvCalFrom" runat="server" ValidationGroup="all" >*</asp:CustomValidator>
<uc3:Calendar ID="calFrom" DateString="" runat="server" />
</td>
<td>
</td>
<td class="font_01">
ToDate:
</td>
<td>
<asp:CustomValidator ID="cvCalTo" runat="server" ValidationGroup="all">*</asp:CustomValidator>
<uc3:Calendar ID="calTo" DateString="" runat="server" />
</td>
<td>
</td>
<td>
</td>
</tr>
<tr align="left" valign="middle">
<td class="font_01">
Unique Code:
</td>
<td>
<asp:TextBox runat="server" ID="txtCode"/>
</td>
<td>
</td>
<td class="font_01">
File Name:
</td>
<td >
<asp:TextBox runat="server" ID="txtFileName"/>
</td>
<td>
<asp:Button ID="Button1" runat="server" CssClass="font_01" Text="Go" Width="50px"
Height="20px" onclick="btnSearch_Click" />
</td>
<td>
<!-- <asp:Button ID="Button2" runat="server" CssClass="font_01" Text="List All" Width="50px"
Height="20px" onclick="btnListAll_Click" />-->
</td>
</tr>
<tr valign="middle">
<td></td>
<td colspan="5" >
</td>
<td></td>
</tr>
</table>
<table>
<tr>
<td>
<CR:CrystalReportViewer Width="500px" Height="400px" ID="CrystalReportViewer1" runat="server" AutoDataBind="true" />
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
public void loadReport()//(bool loadAll)
{
from = calFrom.DatePicked;
to = calTo.DatePicked;
uniqueCode = txtCode.Text;//Convert.ToString(Session["uniqueCode"]);
fileName = txtFileName.Text;//Convert.ToString(Session["fileName"]);
AirDataAccess ada = new AirDataAccess();
List<AirData> alist=null;
alist = ada.GetAllRawLogByFields(from, to, uniqueCode, fileName);
ReportUrl = @"~\Reports\RawLogData.rpt";
reportDocument.Load(Server.MapPath(ReportUrl));
// reportDocument.SetDatabaseLogon(ConfigurationManager.ConnectionStrings.["MACCUserID"], ConfigurationManager.AppSettings["MACCPwd"]);
reportDocument.SetDataSource(alist);
CrystalReportViewer1.DataBind();
CrystalReportViewer1.Visible = true;
CrystalReportViewer1.ReportSource = reportDocument;
CrystalReportViewer1.RefreshReport();
}
protected void Page_UnLoad(object sender, EventArgs e)
{
try
{
if (reportDocument != null)
{
reportDocument.Close();
reportDocument.Dispose();
reportDocument = null;
//Session["reportUrl"] = null;
}
}
catch (Exception ex)
{//handle error here
}
}