Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/300.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 将子接口设置为数据集时,RDLC报告无法识别继承的接口成员_C#_Inheritance_Reporting Services_Interface_Rdlc - Fatal编程技术网

C# 将子接口设置为数据集时,RDLC报告无法识别继承的接口成员

C# 将子接口设置为数据集时,RDLC报告无法识别继承的接口成员,c#,inheritance,reporting-services,interface,rdlc,C#,Inheritance,Reporting Services,Interface,Rdlc,假设我有这两个接口 interface IParentBusinessObject { string Property1 { get; } string Property2 { get; } } interface IChildBusinessObject : IParentBusinessObject { int Property3 { get; } string Proeprty4 { get; } } 如果我试图通过Visual Studio 2013报

假设我有这两个接口

interface IParentBusinessObject
{
    string Property1 { get; }
    string Property2 { get; }
}

interface IChildBusinessObject : IParentBusinessObject
{
    int Property3 { get; }
    string Proeprty4 { get; }
}
如果我试图通过Visual Studio 2013报表向导将
IChildBusinessObject
设置为数据集,它将识别成员
Property3
Property4
,但不会识别继承的成员
Property1
Property2
。在设置数据集时,我确保继承层次结构中的所有接口都可供选择。例如,我可以选择
IParentBusinessObject
作为一个数据集来报告
Property1
Property2
,或者我可以选择
IChildBusinessObject
,只报告
Property3
Property4

其他一些可能很重要的信息

  • 我的数据集的所有接口和类都位于与我的报表不同的单独程序集中
  • 当我使用一个具体的类作为数据集而不是接口时,我可以看到所有成员,包括继承的成员
  • 将接口用作数据集时,仅识别
    System
    类型的成员。我定义的所有类型都不会显示。(同样,具体类没有问题)
  • 如果我使用接口作为数据集设置报表,然后尝试键入应该是什么表达式以获得继承属性,则会抛出错误。(表达式示例:
    =Fields!Property1.Value
有人知道如何让这些RDLC报告完全识别我的接口成员吗

仅仅使用一个具体的类作为我的数据集就可以解决这个问题。但是,如果可能的话,我希望避免将我的具体类型暴露给外部程序集。到目前为止,我的代码仅在界面外运行就非常有效,我不想将这些业务对象暴露给外部代码,即使是使用
InternalsVisisbleTo
,只是为了适应此报告软件