.NET 中的报告闪烁

发布于 2024-11-24 17:01:18 字数 532 浏览 3 评论 0原文

我有一个 .NET 报告,它使用业务对象作为其数据源绑定到 RDLC 文件。该报告采用我在 Page_Init 上设置的参数。我遇到的问题是视图不断刷新,发出连续的 AJAX 请求但不显示任何内容。我在 DAL 方法上设置了断点,它们仅被调用一次,但 AJAX 请求是恒定的。我不知道为什么会发生这种情况。这是我的报表查看器定义:

<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"/>

这真的让我难住了,不知道还能尝试什么。

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 constantly 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

_畞蕅 2024-12-01 17:01:18

如果您在 Page_Load 中提供了任何参数,请将它们移至 Page_Init。

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

绮烟 2024-12-01 17:01:18
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();
    }

}
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();
    }

}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文