Skip to main content
Post a question

Notifications

Community site session details

Community site session details

Session Id : 8fxShzBXV0Y48rdf+Bcqqd
Microsoft Dynamics AX (Archived)

Dynamics AX reporting(Visual Studio project) use a simple query(own select)

Like (0) ShareShare
ReportReport
Posted on 9 Mar 2010 13:55:40 by 1,683
How to use a simple query in Dynamics AX reporting? I can use a query from Axapta, but I need to write my own select.

*This post is locked for comments

  • Andre Classen Profile Picture
    5 on 12 Mar 2010 at 17:21:12
    Re: Re: Re: Re: Re: Re: Dynamics AX reporting(Visual Studio project) use a simple query(own select)

    Hi,

    You can execute an Ax Query from a datamethod.
    See details on MSDN: http://msdn.microsoft.com/en-us/library/cc553656.aspx

    It would look like this:

    [DataMethod(), AxSessionPermission(SecurityAction.Assert)]
    public static DataTable GetCustomerData()
    {
        // Create a data table.
        DataTable table = new DataTable();

        // Execute the CustGroupSRS query that is defined in Microsoft
        // Dynamics AX. Select all the fields from the query.
        table = AxQuery.ExecuteQuery("select * from CustGroupSRS");

        // Return the data table.
        return table;
    }

    Or you could build a query directly against an AX table. See the following MSDN article for details.
    http://msdn.microsoft.com/en-us/library/cc587341.aspx

    I hope this helps.


    --
    This posting is provided "AS IS" with no warranties, and confers no rights

     

  • user5555 Profile Picture
    7,435 on 10 Mar 2010 at 07:02:13
    Re: Re: Re: Re: Re: Dynamics AX reporting(Visual Studio project) use a simple query(own select)

    Hi,

    I think you can use AIF or business connector for this. The AX query is then available for the outside world like VS Reporting through a webservice or through code (business connector). I think reporting services as defined by AX is the best way to go. I do not see the advantage why you want to use VS project for it. But that is up to you.

    J.

  • Adrian Pascari A Profile Picture
    1,683 on 10 Mar 2010 at 06:55:50
    Re: Re: Re: Re: Dynamics AX reporting(Visual Studio project) use a simple query(own select)
    I mean an AX query in a separate independent VS Studio project.
  • user5555 Profile Picture
    7,435 on 10 Mar 2010 at 04:57:54
    Re: Re: Re: Dynamics AX reporting(Visual Studio project) use a simple query(own select)

    You mean an AX query in a separate independent VS Studio project? Or the use of reporting services on top of AX? I think the last is the best way to go.

  • Adrian Pascari A Profile Picture
    1,683 on 10 Mar 2010 at 04:39:11
    Re: Re: Dynamics AX reporting(Visual Studio project) use a simple query(own select)
    I know how to use Axapta queries, but I need to use my own query directly in Visual Studio Project. I see here, in DataSet Properties(In report) - Data Source Type - Business Logical. How to use this feature ?
  • user5555 Profile Picture
    7,435 on 09 Mar 2010 at 18:28:56
    Re: Dynamics AX reporting(Visual Studio project) use a simple query(own select)

    select InventTable

    is the simplest. The syntax is more or less the same as SQL. You can look at samples yourself in the AOT. Define your requirement and then lookup the code and try to understand the sample. I think a report uses a datasource. Not sure, not done so far. Copy and existing report and play around with it. Also see the Inside Dynamics book, I think it has a sample also.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,944 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,838 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans
Loading started