我正在尝试在Microsoft Dynamics AX中的AOT中创建一个类编码。我正在做的是在Microsoft DynamicsAX 2012中开发SSRS报告。因此,出于练习目的,我实际上是通过本教程链接:http://www.dynamics101.com/2013/09/developing-ssrs-report-using-report-data-provider-microsoft-dynamics-ax-2012/。请帮忙。谢谢你
但是,我收到的语法错误是:
语法错误
\类\ CustReportRDPDemoDP \ classDeclaration
classDeclaration
错误:9999
此代码行发生错误:
[SRSReportDataSetAttribute(tablestr( 'CustReportRDPDemoTmp'))]
我的以下代码如下:
class CustReportRDPDemoDP extends SRSReportDataProviderBase
{
//Temproaray table buffer
CustReportRDPDemoTmp custReportRDPDemoTmp;
[SRSReportDataSetAttribute(tablestr('CustReportRDPDemoTmp'))]
public CustReportRDPDemoTmp getCustReportRDPDemoTmp()
{
select * from custReportRDPDemoTmp;
//return the buffer
return custReportRDPDemoTmp;
}
///<summary>
/// Processes the SQL Server Reporting Services report business logic
/// </summary>
/// <remarks>
/// This method provides the ability to write the report business logic. This method will be called by
/// SSRS at runtime. The method should compute data and populate the data tables that will be returned
/// to SSRS.
/// </remarks>
public void processReport(){
CustTable custTable;
SalesTable salesTable;
//select all customers
while select * from custTable
{
//clear the temporary table
custReportRDPDemoTmp.clear();
//assign customer account and name
custReportRDPDemoTmp.CustAccount = custTable.AccountNum;
custReportRDPDemoTmp.Name = custTable.name();
//select count of invoiced sales order of customer
select count(RecId) from salesTable
where salesTable.CustAccount == custTable.AccountNum
&& salesTable.SalesStatus == SalesStatus::Invoiced;
custReportRDPDemoTmp.SalesOrderInvoiceCount = int642int(salesTable.RecId);
//insert in temporary table buffer
custReportRDPDemoTmp.insert();
}
}
}
答案 0 :(得分:0)
你需要有3个单独的方法,你不能只在classDeclaration方法中抛出代码。
classDeclaration应该是:
class CustReportRDPDemoDP extends SRSReportDataProviderBase
{
//Temporary table buffer
CustReportRDPDemoTmp custReportRDPDemoTmp;
}
和另外两个代码块应该是他们自己的方法。