0

我正在尝试在我的 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/。请帮忙。谢谢你

但是,我收到一个语法错误,上面写着:

语法错误
\Classes\CustReportRDPDemoDP\classDeclaration
classDeclaration
Err: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
        &amp;&amp; salesTable.SalesStatus == SalesStatus::Invoiced;
        custReportRDPDemoTmp.SalesOrderInvoiceCount = int642int(salesTable.RecId);
        //insert in temporary table buffer
        custReportRDPDemoTmp.insert();
       }
 }
}
4

1 回答 1

0

你需要有 3 个独立的方法,你不能只是把代码扔到 classDeclaration 方法中。

classDeclaration 应该只是:

class CustReportRDPDemoDP extends SRSReportDataProviderBase
{
    //Temporary table buffer
    CustReportRDPDemoTmp custReportRDPDemoTmp;
}

而另外两个代码块应该是它们自己的方法。

于 2015-05-26T14:32:31.893 回答