【问题标题】:How to connect data to a devexpress blazor report?如何将数据连接到 devexpress blazor 报告?
【发布时间】:2020-08-27 21:21:58
【问题描述】:

我有一个 .net 核心项目,它在 blazor 页面上包含一个报表查看器,我试图将它绑定到数据源但没有成功

<div style="width: 100%; margin: auto;">
    <DxDocumentViewer ReportUrl="PatientPending" Height="800px" Width="100%" @ref="Report">
        <DxDocumentViewerTabPanelSettings Width="180" />
    </DxDocumentViewer>
</div>

这是我的数据源

[DisplayName("PatientPending")]
    [HighlightedClass]
    public class PatientPendingDataSource {
        
        public PatientPendingDataSource() {
            
        }

        [HighlightedMember]
        public IEnumerable<Patient> GetData() {
            return new List<Patient> {
                new Patient {
                    Id = 5
                },
                new Patient {
                    Id = 6
                },
            };

        }
    }

此报告的数据源是 typeof(PatientPendingDataSource) 和“GetData”的数据成员我在 GetData 方法上设置了一个断点,但它从未到达,我做错了什么?

【问题讨论】:

    标签: devexpress reporting blazor


    【解决方案1】:

    Blazor 应用程序中的文档查看器从 report storage 获取报告。因此,您需要将此报告定位到存储中并仅指定ReportUrl 属性。将此报告绑定到IEnumerable&lt;Patient&gt; 时,请确保您已检查数据源向导中的以下条目,然后应在运行时调用您的方法:

    1)

    2)

    【讨论】:

      猜你喜欢
      • 2021-01-07
      • 1970-01-01
      • 1970-01-01
      • 2017-04-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-12-04
      • 1970-01-01
      相关资源
      最近更新 更多