How to get a datatable from AX to SSRS report

We can easily get a datatable from AX to SSRS report. All the business logic can be written in AX, and the SSRS is the data showing platform.

[DataMethod(), AxSessionPermission(SecurityAction.Assert)]
public static DataTable GetData(string _PurchaseOrderId)
{
    AxaptaWrapper ax = SessionManager.GetSession();
    DataTable dt = (DataTable)ax.CallStaticClassMethod("ClassName", "StaticMethod", Parm1, Parm2...);

    return dt;
}
public static System.Data.DataTable GetData()
{
    System.Data.DataTable               m_DataTable;
    System.Data.DataColumnCollection    m_DataColumnCon;
    System.Data.DataRowCollection       m_DataRowCon;
    System.Data.DataRow                 m_DataRow;
    CustTable                           m_CustTable;
    InteropPermission                   permission = new InteropPermission(InteropKind::ClrInterop);
    ;

    permission.assert();

    m_DataTable     = new System.Data.DataTable();
    m_DataColumnCon = m_DataTable.get_Columns();
    m_DataRowCon    = m_DataTable.get_Rows();

    m_DataColumnCon.Add("AccountNum");
    m_DataColumnCon.Add("NameAlias");

    while select m_CustTable
    {
        m_DataRow = m_DataTable.NewRow();
        m_DataRow.set_Item("AccountNum", m_CustTable.AccountNum);
        m_DataRow.set_Item("NameAlias", m_CustTable.NameAlias);
        m_DataRowCon.Add(m_DataRow);
    }

    return m_DataTable;
}

  

  

时间: 2024-10-13 12:06:19

How to get a datatable from AX to SSRS report的相关文章

Upgrading AX 2009 SSRS Report To AX 2012 SSRS Report

In AX 2012, the old SSRS reports for AX 2009 is stored in the AOT node "Report Libraries". We can find it all in the view 'Application Explorer' of visual studio,  but we can't modify it as usual. Refer to the MSDN's essay, if we want to modify

AX 2009 SSRS Report deploy language

Reduce the number of Reports Libraries and Reports per Language. By default, reports from all languages that are enabled in the LANGUAGETABLE of the AX database are deployed (this can be over 40+ languages). Prior to the reports deployment you can ch

AX 2009 SSRS report installation and configuration

1. Install and configure the SQL server reporting server, then add a user as administrator for current user, the user name format is just domain\user. 2. Install the ax reporting extending and development extending.

AX 2012 SSRS Report Export To File

Args Args; SrsReportRunController controller; Common _record; SRSPrintDestinationSettings printSettings; ; controller= new SrsReportRunController(); controller.parmReportName("SysDataBaseLog.Report"); Args = new Args(); args.record(_record); con

AX SSRS report data helper

While we develop a ax ssrs report often using 'Business Logic' rather than 'AX Queries'. The 'Business Logic' is base on a AX class, there is a static method return a data type as 'System.Data.DataTable'.  While using the 'DataTable' type, we need to

Deploy SSRS Report In AX 2012

1.The SSRS report has only one design: Use the menuitem of 'Output', select the object type 'SSRSReport' and assign the right SSRS report name and design. 2.The SSRS report has mutiple designs: Create a new class extending the class 'SrsReportRunCont

AX 2012 SSRS 报表发布

在开发环境没有域管理里权限, 在AX ,和vs studio 2010,2012 中部署都失败, 最后,用ax 自己powershell管理终端成功把report 部署取ssrs上: Publish-axreport –reportname avtestreportsec -SkipReportServerAdminCheck 参考: 1.http://technet.microsoft.com/en-us/library/dd309703.aspx 2.http://blogs.msdn.co

How to deploy SSRS report from AX

To deploy reports from within Microsoft Dynamics AX 1.In the AOT, expand the Report Libraries node. 2.Right-click the report library that you want to deploy, and then click Deploy. This launches the deployment utility. 3.In the dialog box, select any

How to debug the SSRS report in AX 2012

1.Add the AOS service account to the user group 'Microsoft Dynamics AX Debugging Users'. 2.Set up the AX server configuration and client configuration parameters and then restart the AOS service. 3.Add a break point in the method of 'processReport'.