Export (0) Print
Expand All

Walkthrough: Creating an Analyze Data Button on a List Page [AX 2012]

Updated: April 8, 2014

Applies To: Microsoft Dynamics AX 2012 R3, Microsoft Dynamics AX 2012 R2

You can use Power View to create interactive ad-hoc reports in Microsoft Dynamics AX. Several list pages have an Analyze data button that launches a Power View report designer. The Power View report designer connects to an Analysis Cube and allows you to drag and drop fields for quick analysis. This topic describes how to add an Analyze data button to additional list pages.

To add an Analyze data button to a list page, you must:

  • Create a data source that connects your Power View report to a cube.

  • Create a class that gets the URL of the Power View report designer.

  • Create a menu item that specifies the class you created.

  • Create a button that points to the menu item you created.

Prerequisites

  • Microsoft SharePoint Server 2010 or 2013 must be installed.

  • Microsoft SQL Server Reporting Services 2012 Service Pack 1 must be installed in SharePoint integrated mode with cumulative update 4 applied.

  • The Power View site collection feature in SharePoint must be activated. For instructions about how to activate this feature, see the information in the Install Reporting Services SharePoint Mode as a Single Server Farm topic.

  • Microsoft SQL Server Analysis Services 2012 Service Pack 1 must be installed in multidimensional mode with cumulative update 4 applied.

  • Microsoft Dynamics AX 2012 R2 must be installed. The following components are required:

  • Cumulative update 6 for Microsoft Dynamics AX 2012 R2 must be installed. For more information about how to install cumulative update 6 for Microsoft Dynamics AX 2012 R2, see the Knowledge Base article for cumulative update 6.

    After you install cumulative update 6, you must redeploy three page definitions. To deploy these page definitions, complete the following steps. Keep in mind, when you redeploy the Role Center pages, you will lose customizations made to the pages.

    1. Open the AOT.

    2. Expand the Web > Web Files > Page Definitions node.

    3. Right-click RoleCenterCFOPV and click Deploy Element.

    4. Right-click RoleCenterTreasurerPV and click Deploy Element.

    5. Right-click PowerViewDataSourceGeneratorPV and click Deploy Elements.

You must add a data source to your SharePoint library to connect a Power View report designer to a cube.

To create a data source

  1. Go to the Power View Reports folder of your Enterprise Portal site. The URL for this folder is typically http://<SharePointServerName>/sites/DynamicsAX/Power%20View%20Reports.

    NoteNote

    Data source connections are created automatically when you deploy role center pages to Enterprise Portal. You can browse the Power View Reports folder to see the data source connections that already exist. For information about creating and deploying role center pages, see How to: Create a Role Center.

  2. Click Documents > New Document > Report Data Source. The Data Source Properties page is displayed.

  3. In the Name field, enter a name for the data source. For example, if the data source will connect to the Accounts receivable cube, you may want to name the data source Accounts receivable cube.

  4. In the Data Source Type area, select Microsoft BI Semantic Model for Power View.

  5. In the Connection string area, enter the following connection string:

    Provider=MSOLAP.4;Integrated Security=SSPI;Persist Security Info=True;Data Source=[ServerName];Initial Catalog=[DatabaseName];Locale identifier=1033;Cube=[CubeName]

    NoteNote

    The Locale identifier designates the language of the labels that will be shown in Power View reports. For example, if you want the dimensions and measures to be shown in German, you must add German translations to the cube and specify the Locale identifier for German.

    Note the following documentation conventions that are used in the connection string:

    Value

    Description

    ServerName

    The name of the server on which Analysis Services is installed.

    DatabaseName

    The name of the Analysis Services database that contains the cube that you want to connect to.

    CubeName

    The name of the cube that contains the data that you want to display on the report.

    For example, if you want to connect to the Accounts receivable cube that is provided with Microsoft Dynamics AX, the default connection string is:

    Provider=MSOLAP.4;Integrated Security=SSPI;Persist Security Info=True;Data Source=[ServerName];Initial Catalog=Dynamics AX initial;Locale identifier=1033;Cube=Accounts receivable cube

  6. In the Credentials area, select Windows authentication (integrated) or SharePoint user.

  7. Click Test Connection to verify the connection to the cube.

  8. In the Availability area, select the Enable this data source check box.

  9. Click OK. The data source is created.

You need a class that uses the Power View integration framework to get the URL of a Power View report designer with a cube. The PowerViewReporting class generalizes this implementation and fulfills specific error handling requirements. If you use the PowerViewReporting class, be aware that the data source name and cube name must be an exact match, and you must pass the name of the cube as the first parameter on the action menu item in the next section. The following procedure demonstrates how to create your own class called MyPVClass.

To create a class

  1. In the AOT, right-click Classes, and then click New Class. Name the class MyPVClass. For more information about classes, see Classes in X++.

  2. Right-click the class you created, point to New, and then click Method.

  3. In Code Editor, add code for method1 to name the method main and to get the URL of the Power View designer for the cube. The following code example shows how to verify that Power View is available and how to get the URL of the data source:

    public static void main(Args args)
    {
            if (SrsReportHelper::isPowerViewModelDeployed('Accounts receivable cube'))
        {
            infolog.urlLookup(SrsReportHelper::getPowerViewDataSourceUrlClient('Accounts receivable cube'));
        }
        else
        {
           // Cube has not been deployed – display error message
        }
    
    }
    
    

After you create the class, you create a menu item that references that class. The class indicates the cube the Power View report designer connects to. If you use the existing PowerViewReporting class, you must specify the cube the Power View report designer connects to in the Parameters property.

To create a menu item

  1. In the AOT, right-click AOT > Menu Items > Action, and then click New Menu Item.

  2. Right-click the new menu item and then click Properties.

  3. Set the following properties:

    Property

    Value

    Name

    Specify a name for your menu item. For example, CreatePowerViewReportAccountsReceivableCube.

    Label

    Analyze data

    HelpText

    Provide help text for the button.

    ObjectType

    Class

    Object

    Specify the class you created. For example, MyPVClass. You can also use the PowerViewReporting class if you specify the cube to connect to using the Parameters property.

    Parameters

    If you use the PowerViewReporting class instead of creating your own class, specify the name of the cube to connect the Power View report designer to.

    NormalImage

    12578

    ImageLocation

    EmbeddedResource

After you create a menu item, you can create a button that points to the menu item. The following procedure demonstrates how to create an Analyze data button to launch a Power View report designer page.

To create a button

  1. In the AOT, navigate to the list page form that you want to add an Analyze Data button to.

  2. Expand Designs > Design > ActionPane > ActionPaneTab, and identify the button group you want to add the button to.

  3. Right-click the button group control, point to New Control, and then click MenuItemButton.

    NoteNote

    To specify the location of the button in the button group, use the ALT+UP ARROW or ALT+DOWN ARROW to position the button before or after an existing button.

  4. Specify the following properties for the new button:

    Property

    Value

    Name

    Specify a name for the button. For example, AnalyzeData.

    Big

    Yes

    MenuItemType

    Action

    MenuItemName

    Specify the menu item you created in the previous section. For example, CreatePowerViewReportAccountsReceivableCube

  5. Add logic to the form load event to hide the button if Power View is not configured. For example, expand the Methods node of the form, and then double-click the init method. Add the following line of code:

    ReportingGroup.visible(SrsReportHelper::isPowerViewConfigured());
    

To view the button, right-click the form name in the AOT, and then click Open. The client displays the button in the list page action pane. To test the button action, click the button.


Announcements: To see known issues and recent fixes, use Issue search in Microsoft Dynamics Lifecycle Services (LCS).
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft