我有一个水晶报告运行正常,直到我在Firefox中测试它。它显示第一次加载时的数据/报告,但是当我点击报告过滤器的“开始”按钮时,它会显示空白报告,除非我点击这些按钮中的任何一个 - 放大,缩小,页面/浏览器刷新并输入页码。这只发生在firefox中。 Chrome和IE加载就好了。顺便说一下,我正在使用site.master页面。
我尝试了什么:
可能导致什么?有什么建议吗?
<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
}
}
答案 0 :(得分:0)
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
<asp:Panel ScrollBars="Auto" runat="server">
<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>
</asp:Panel>
<asp:UpdatePanel ID="updatePnl" runat="server" >
<ContentTemplate>
<CR:CrystalReportViewer Width="500px" Height="400px" ID="CrystalReportViewer1" runat="server" AutoDataBind="true" />
</ContentTemplate>
</asp:UpdatePanel>
执行此类更改并删除卸载代码........
答案 1 :(得分:0)
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="InventoryDocumentReportParameterCry.aspx.cs" Inherits="TexERP.ReportCrystal.InventoryDocumentReportParameterCry" %>
<%@ Register Assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
Namespace="CrystalDecisions.Web" TagPrefix="CR" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
<telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" />
<asp:Panel ID="pnlAddRecord" runat="server" BackColor="White" Height="200px" Width="700px"
Visible="true">
<table width="100%" style="border: Solid 3px #005f9c; width: 100%; height: 100%;"
cellpadding="0" cellspacing="1">
<tr style="background-color: #005f9c">
<td colspan="4" style="height: 8%; color: White; font-weight: bold; font-size: larger"
align="center">
<asp:Label ID="lblReportHeading" runat="server" Text=""></asp:Label>
</td>
</tr>
<tr>
<td align="left" style="text-align: right">
<asp:Label ID="lblFrmDoc" runat="server" Text="From Document No:"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtFromDocumentNo" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator runat="server" ID="rfvFromDocumentNo" Display="None"
ControlToValidate="txtFromDocumentNo" InitialValue="" ValidationGroup="FinalSave"
ErrorMessage="From Document No is Mandatory" ForeColor="Red"></asp:RequiredFieldValidator>
<ajaxToolkit:ValidatorCalloutExtender ID="vceFromDocumentNo" TargetControlID="rfvFromDocumentNo"
runat="server">
</ajaxToolkit:ValidatorCalloutExtender>
</td>
<td align="left">
<asp:Label ID="lblToDoc" runat="server" Text="To Document No:"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtToDocumentNo" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator runat="server" ID="rfvToDocumentNo" Display="None" ControlToValidate="txtToDocumentNo"
InitialValue="" ValidationGroup="FinalSave" ErrorMessage="To Document No is Mandatory"
ForeColor="Red"></asp:RequiredFieldValidator>
<ajaxToolkit:ValidatorCalloutExtender ID="vceToDocumentNo" TargetControlID="rfvToDocumentNo"
runat="server">
</ajaxToolkit:ValidatorCalloutExtender>
</td>
</tr>
<tr>
<td align="right" colspan="4">
<asp:Button ID="btnSubmit" runat="server" Text="Show Report" OnClick="btnSubmit_Click"
ValidationGroup="FinalSave" />
<asp:Button ID="btnCancel" runat="server" Text="Reset" UseSubmitBehavior="false"
OnClick="btnCancel_Click" />
</td>
</tr>
</table>
</asp:Panel>
<asp:UpdatePanel ID="updpnlReport" runat="server">
<ContentTemplate>
<CR:CrystalReportViewer ID="crvInventoryDocumentParameter" runat="server"
AutoDataBind="true" EnableParameterPrompt="false"
EnableDatabaseLogonPrompt="False" ReuseParameterValuesOnRefresh="true" HasToggleParameterPanelButton = "false" HasCrystalLogo ="False"
/>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
使用此代码作为参考,这是我的代码