Microsoft Dynamics Error: Developing SSRS report using Report Data Provider

Microsoft Dynamics Error: Developing SSRS report using Report Data Provider

我正在尝试在我的 Microsoft Dynamics AX 的 AOT 中创建 class 编码。我正在做的是在 Microsoft DynamicsAX 2012 中开发一个 SSRS 报告。因此,出于练习目的,我实际上是在学习本教程 link:http://www.dynamics101.com/2013/09/developing-ssrs-report-using-report-data-provider-microsoft-dynamics-ax-2012/。请帮忙。谢谢

但是,我收到一个语法错误:

Syntax error
\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();
       }
 }
}

你需要有3个独立的方法,不能把代码丢在classDeclaration方法里。

classDeclaration 应该是:

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

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