开发者

Report in .NET Flickering

开发者 https://www.devze.com 2023-03-20 03:45 出处:网络
I have a .NET report, which binds to an RDLC file using a business object for it\'s datasource. The report take a paremeter which I set on Page_Init. The problem I have is that the view c开发者_开发技

I have a .NET report, which binds to an RDLC file using a business object for it's datasource. The report take a paremeter which I set on Page_Init. The problem I have is that the view c开发者_开发技巧onstantly keeps refreshing, making continuous AJAX requests but displaying nothing. I've set breakpoints on my DAL methods and they're only called once, yet the AJAX requests are constant. I have no idea why this is happening. This is my reportviewer definition:

<rsweb:ReportViewer ID="ReportViewer2" runat="server" Font-Names="Verdana" 
            Font-Size="8pt" Height="834px" InteractiveDeviceInfos="(Collection)" 
            WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" Width="910px">
        <LocalReport ReportPath="Report1.rdlc"/>

This one really has me stumped, not sure what else to try.


If you supplied any parameters in Page_Load, move them to Page_Init.


using Microsoft.Reporting.WebForms;

public partial class ExportSoftware_Depb_Edi_Annex_B_Report : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Bind();
    }
    private void Bind()
    {
        DataSet sd = new DataSet();
        ExecuteProcedures ex = new ExecuteProcedures(1, CommonStrings.ConnectionString);
        ex.Parameters.Add("@intAnnexure_B_Id", SqlDbType.Int, Session["id"]);
        sd  = ex.LoadDatasetWithProcedure("ProcDEPBAnnexureBBind_Report");
        ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/ExportSoftware/Report/Depb_Edi_Annex_B.rdlc");
        ReportDataSource rds = new ReportDataSource();
        rds.Name = "Depb_Edi_Annex_B_DataTable1";
        rds.Value = sd.Tables[0];
        ReportViewer1.LocalReport.DataSources.Clear();
        ReportViewer1.LocalReport.DataSources.Add(rds);
        ReportViewer1.LocalReport.Refresh();
        ReportViewer1.Visible = true;
        ReportViewer1.Dispose();
    }

}
0

精彩评论

暂无评论...
验证码 换一张
取 消