RDLC (VS 2010) 如何访问 DataObject 上的嵌套类或数组
如何访问 RDLC 上的 TD.SubNumber 属性和 Numbers[]?我的表达式“=Fields!TD.Value.SubNumber”和“=Fields!Numbers.Value(0)”不断收到#Error。
public class TestData
{
TestSubData tdata = new TestSubData();
public TestSubData TD
{
get { return tdata; }
set { tdata = value; }
}
string m_Description;
public string Description
{
get { return m_Description; }
set { m_Description = value; }
}
int[] m_Numbers = new int[12];
public int?[] Numbers
{
get { return m_Numbers; }
}
}
public class TestSubData
{
int x;
public TestSubData()
{
}
public int SubNumber
{
get { return x; }
set { x = value; }
}
}
How can I access the TD.SubNumber property and Numbers[] on RDLC? I keep getting #Error on my expressions "=Fields!TD.Value.SubNumber" and "=Fields!Numbers.Value(0)".
public class TestData
{
TestSubData tdata = new TestSubData();
public TestSubData TD
{
get { return tdata; }
set { tdata = value; }
}
string m_Description;
public string Description
{
get { return m_Description; }
set { m_Description = value; }
}
int[] m_Numbers = new int[12];
public int?[] Numbers
{
get { return m_Numbers; }
}
}
public class TestSubData
{
int x;
public TestSubData()
{
}
public int SubNumber
{
get { return x; }
set { x = value; }
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
向每个嵌套类添加“可序列化”属性,然后您可以使用以下表达式进行引用:
“=Fields!TD.Value.SubNumber”
Add the "serializable" attribute to each of the nested classes, then you can reference with expressions such as:
"=Fields!TD.Value.SubNumber"