Reporting services 需要知道如何在AX7的SSRS报告中使用显示方法
我需要知道如何在SSRS报告中使用显示方法。我有个问题。我已经为现有表创建了扩展类。在该类下,我编写了显示方法Reporting services 需要知道如何在AX7的SSRS报告中使用显示方法,reporting-services,dynamics-ax7,dynamics-365-operations,Reporting Services,Dynamics Ax7,Dynamics 365 Operations,我需要知道如何在SSRS报告中使用显示方法。我有个问题。我已经为现有表创建了扩展类。在该类下,我编写了显示方法 [SysClientCacheDataMethodAttribute(true)] public display CustAccount CustAccount(ProdTable _prodTable) { CustAccount custAccount; if (_prodTable.InventRefType == InventRefType::Sales)
[SysClientCacheDataMethodAttribute(true)]
public display CustAccount CustAccount(ProdTable _prodTable)
{
CustAccount custAccount;
if (_prodTable.InventRefType == InventRefType::Sales)
{
custAccount = SalesTable::find(_prodTable.InventRefId).CustAccount;
}
return CustAccount;
}
我的报告是基于查询的报告。
我能够在报告中看到显示方法,并且我已经将该字段放到了报告设计中。但这份报告毫无价值
请引导我通过这个 如果要向表中添加
display
方法,则该方法没有正确的签名
如果要使用该属性,代码应为:
[ExtensionOf(tableStr(ProdTable))]
public final class ProdTable_Extension
{
[SysClientCacheDataMethodAttribute(true)]
public display CustAccount custAccount()
{
CustAccount custAccount;
if (this.InventRefType == InventRefType::Sales)
{
custAccount = SalesTable::find(this.InventRefId).CustAccount;
}
return CustAccount;
}
}
public static class ProdTable_Extension
{
[SysClientCacheDataMethodAttribute(true)]
public static display CustAccount custAccount(ProdTable _this)
{
CustAccount custAccount;
if (_this.InventRefType == InventRefType::Sales)
{
custAccount = SalesTable::find(_this.InventRefId).CustAccount;
}
return CustAccount;
}
}
或者,您可以使用a(通常用于绑定在表单中的显示方法),您的代码应该是:
[ExtensionOf(tableStr(ProdTable))]
public final class ProdTable_Extension
{
[SysClientCacheDataMethodAttribute(true)]
public display CustAccount custAccount()
{
CustAccount custAccount;
if (this.InventRefType == InventRefType::Sales)
{
custAccount = SalesTable::find(this.InventRefId).CustAccount;
}
return CustAccount;
}
}
public static class ProdTable_Extension
{
[SysClientCacheDataMethodAttribute(true)]
public static display CustAccount custAccount(ProdTable _this)
{
CustAccount custAccount;
if (_this.InventRefType == InventRefType::Sales)
{
custAccount = SalesTable::find(_this.InventRefId).CustAccount;
}
return CustAccount;
}
}
你混合使用了它们,我不确定它是否能起作用。就我个人而言,我从未在AX365的SSRS中使用过显示方法,但我想第一个解决方案(我描述的)应该可以工作
我希望它能对您有所帮助。第一个解决方案以某种形式起作用。它没有按照我的代码工作。但是仍然无法在SSR上找到它。我发现了一些奇怪的行为。如果我将方法签名保留在代码中,它在表单上运行正常,但报表没有执行,它会抛出错误“报表数据集执行期间发生错误”。另一方面,如果我按照代码更改签名,表单会抛出错误,但报表运行正常。但很明显,显示方法没有任何价值。