繁体   English   中英

RDLC报告未显示数据

[英]RDLC report is not showing Data

我已经阅读了所有可以找到的问题答案,但是都没有解决我的问题。

我有一个类代表我的数据的一行:

public class SimpleGeofenceReportDTO
{
    public string AssetId { get; set; }

    public string CompanyId { get; set; }

    public string SiteId { get; set; }

    public string CategoryId { get; set; }

    public string StartDateTime { get; set; }

    public string EndDateTime { get; set; }

    public string GeofenceId { get; set; }

    public string GeofenceEvent { get; set; }

    public string EventDateTime { get; set; }

}

从Db读取数据并转换为DTO列表:

var reportList = geofenceReport.ToList();
                var report = new List<SimpleGeofenceReportDTO>();
                foreach (var geofenceRecord in reportList)
                {
                    report.Add(new SimpleGeofenceReportDTO()
                                   {
                                       AssetId = geofenceRecord.iAssetId.ToString(),
                                       CategoryId = geofenceRecord.iCategoryId.ToString(),
                                       EndDateTime = geofenceRecord.dtUTCDateTime.ToString("dd/MM/yyyy"),
                                       GeofenceId = geofenceRecord.iGeofenceId.ToString(),
                                       GeofenceEvent = geofenceRecord.eEventCode == 6 ? "Geofence Enter" : "Geofence Exit"

                                   });
                }

我的报告CS代码:

   var geofenceData = GETLISTOFGEOFENCEDTO();
    GeofenceSummaryReportViewer.ProcessingMode = ProcessingMode.Local;
                        GeofenceSummaryReportViewer.LocalReport.EnableHyperlinks = true;
                        GeofenceSummaryReportViewer.HyperlinkTarget = "_blank";
                        GeofenceSummaryReportViewer.LocalReport.ReportPath = sPath;
     GeofenceSummaryReportViewer.LocalReport.DataSources.Add(
                            new ReportDataSource("GroupGeofenceSummaryReportDataTable", geofenceData ));
      GeofenceSummaryReportViewer.LocalReport.EnableExternalImages = true;
     GeofenceSummaryReportViewer.LocalReport.Refresh();

报表中的数据集

ASP.NET Web页面代码:

 <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" />


    <div id="ReportContentDiv" runat="server">
        <rsweb:ReportViewer ID="GeofenceSummaryReportViewer" runat="server"
            Font-Names="Verdana" Font-Size="8pt" WaitMessageFont-Names="Verdana"
            WaitMessageFont-Size="14pt" Width="98%" Height="98%">
            <LocalReport ReportPath="TBReports\GeofenceSummaryReport.rdlc">
            </LocalReport>
        </rsweb:ReportViewer>
    </div>
    <div id="ErrorDiv" runat="server">
        <span style="font-family: Arial; font-size: small; font-weight: bold">Your session has expired, Please login again and then try to generate this report.</span>
    </div>
    </form>

我已经调试了代码。 数据正在从数据库返回,并且报表Div也显示在网页上,但没有数据。

我究竟做错了什么?

报告CS代码的最后一行:

GeofenceSummaryReportViewer.LocalReport.Refresh();

尝试将其更改为此:

GeofenceSummaryReportViewer.RefreshReport();

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM