Walkthrough: Creating an Analyze Data Button on a List Page
Important
This content is archived and is not being updated. For the latest documentation, see Microsoft Dynamics 365 product documentation. For the latest release plans, see Dynamics 365 and Microsoft Power Platform release plans.
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:
Enterprise Portal and Role Centers must be deployed to SharePoint. For more information, see Checklist: Deploy an internal Enterprise Portal site that has Role Centers.
The cubes that are included with Microsoft Dynamics AX must be deployed to Analysis Services. For more information, see Checklist: Configure Analysis Services and deploy cubes.
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.
Open the AOT.
Expand the Web > Web Files > Page Definitions node.
Right-click RoleCenterCFOPV and click Deploy Element.
Right-click RoleCenterTreasurerPV and click Deploy Element.
Right-click PowerViewDataSourceGeneratorPV and click Deploy Elements.
Creating a Data Source
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
Open your browser and go to the Enterprise Portal site. The URL for the Enterprise Portal site is typically http://[SharePointServerName]/sites/DynamicsAX.
Note
For security reasons, integrating Power View with Microsoft Dynamics AX is not supported in environments where the Enterprise Portal site is configured for multiple data partitions.
Go to the Power View Reports folder. The URL for this folder is typically http://[SharePointServerName]/sites/DynamicsAX/Power%20View%20Reports.
Click Documents > New Document > Report Data Source. The Data Source Properties page is displayed.
In the Name field, enter a name for the data source. For example, if the data source will connect to the Retail cube, you may want to name the data source Retail cube.
In the Data Source Type area, select Microsoft BI Semantic Model for Power View.
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=[LocaleID];Cube=[CubeName]
The following table lists the 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.
[LocaleID]
The identifier that designates the language of the labels to display on the report. For example, if you want measures and dimensions to be shown in German, you must add German translations to the cube and specify the locale identifier for German.
For more information about how to add translations to a cube, see Update an Existing SQL Server Analysis Services Project. For a list of the locales that are supported by both Enterprise Portal and SharePoint, see Install Enterprise Portal on a single server.
[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 Retail 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=Retail cube
In the Credentials area, select Windows authentication (integrated) or SharePoint user.
Note
If Analysis Services and Enterprise Portal are installed on different computers, you must use Kerberos security. To configure Kerberos security, see this white paper. After you have configured Kerberos security to work with the servers, complete the following steps:
-
In the Credentials area, select Stored credentials.
-
Enter the user name and the password for the account that is assigned to the Analysis Services server administrator role. In most cases, this is the Business Connector proxy account. For more information, see the Assign the Business Connector proxy account to the Analysis Services server administer role section in Before you configure Analysis Services.
-
Select the Use as Windows credentials check box.
-
Select the Set execution context to this account check box.
-
Click Test Connection to verify the connection to the cube.
In the Availability area, select the Enable this data source check box.
Click OK. The data source is created.
Creating a Class
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
In the AOT, right-click Classes, and then click New Class. Name the class MyPVClass. For more information about classes, see Classes in X++.
Right-click the class you created, point to New, and then click Method.
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 } }
Creating a Menu Item
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
In the AOT, right-click AOT > Menu Items > Action, and then click New Menu Item.
Right-click the new menu item and then click Properties.
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
Creating a Button
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
In the AOT, navigate to the list page form that you want to add an Analyze Data button to.
Expand Designs > Design > ActionPane > ActionPaneTab, and identify the button group you want to add the button to.
Right-click the button group control, point to New Control, and then click MenuItemButton.
Note
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.
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
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.