Drill Through SSRS Report in AX 2012
Today I will demonstrate you that How to create Drill Through reports in AX 2012.
To define a query
- In
Microsoft Dynamics AX, open a New Development Workspace.
- In
the AOT, right-click the Queries node, and then click New Query.
- Right-click
the node for the query, click Rename, and then type Assets.
- Expand
the node for the Assets query.
- Right-click
the Data Dictionary node, and then click Open New Window.
- In
the new window, expand the Tables node.
- Locate
the AssetTable table and drag it onto the Data Sources node for the Assets
query.
- In
the Assets query node, expand the Data Sources node, expand the
AssetTable_1 node, select the Fields node, in the Properties window, set
the Dynamic property to Yes.
- Save
the query.
To create a reporting project
- Open
Microsoft Visual Studio.
- On
the File menu, point to New, and then click Project. The New Project
dialog box displays.
- In
the Installed Templates pane, click Microsoft Dynamics AX, and in the
Templates pane, click Report Model.
- In
the Name box, type SampleDrillthroughReport. In the Location box, type a
location.
- Click
OK.
To create a top-level report
- In
Solution Explorer, right-click the SampleDrillThroughReports project,
point to Add and then click Report.
- In
the Properties window, for the Name property type AssetList. The model
displays in Model Editor with a report named AssetList.
- In
Model Editor, right-click the Datasets node, and then click Add Dataset.
- Select
the node for the dataset.
- In
the Properties window, specify the following values.
Property
|
Value
|
Data Source
|
Dynamics AX
|
Data Source Type
|
Query
|
Default Layout
|
Table
|
Dynamic Filters
|
False
|
Name
|
Assets
|
Query
|
Click the ellipsis button (…). A dialog box
displays where you can select a query that is defined in the AOT and identify
the fields that you want to use. Select the Assets query, click Next, expand
the node for All Fields, and then select the AssetId, and Name fields. When
you are finished selecting the fields, click OK.
|
- In
Model Editor, select the Assets dataset node and drag it onto the Designs
node. An auto design named AutoDesign1 is created for the report.
- Select
the AutoDesign1 node.
- In
the Properties window, set the LayoutTemplate property to
ReportLayoutStyleTemplate and type Assets for the Title property.
- In
Model Editor, expand the AutoDesign1 node, and then select the node for
the AssetsTable data region.
- In
the Properties window, set the style template to TableStyleTemplate and
type Asset list for the Title property.
To create a drillthrough report
- In
Solution Explorer, right-click the SampleDrillThroughReports project,
point to Add, and then click Report.
- In
the Properties window, for the Name property type AssetDetails. The model
displays in Model Editor with a report named AssetDetails.
- Right-click
the Datasets node, and then click Add Dataset.
- Select
the node for the dataset.
- In
the Properties window, specify the following values.
Property
|
Value
|
Data Source
|
Dynamics AX
|
Data Source Type
|
Query
|
Default Layout
|
TopDownList
|
Dynamic Filters
|
False
|
Name
|
Details
|
Query
|
Click the ellipsis button (…). A dialog box
displays where you can select a query that is defined in the AOT and identify
the fields that you want to use. Select the Assets query, click Next, expand
the node for All Fields, and then select the AssetId, Name, SerialNum,
InsuredValue, Make, Model, AssetReplaceCost, and TechInfo1 Fields. When you
are finished selecting the fields, click OK.
|
- In
Model Editor, in the Details dataset, expand the Fields node, select the
node for the AssetReplaceCost field, and in the Properties window, set the
FormatString property to Currency.
- In
the Fields node, select the node for the InsuredValue field, and in the
Properties window, set the FormatString property to Currency.
- In
the Fields node, select the node for the Name field and then click the
Move up button on the Model Editor toolbar until it is first in the list.
Note:-
|
You can also press ALT+UP ARROW or ALT+DOWN ARROW
to move an element up or down in a collection in Model Editor.
|
- Select
the Details node and drag it onto the Designs node. An auto design named
AutoDesign1 is created for the report.
- Select
the AutoDesign1 node.
- In
the Properties window, set the LayoutTemplate property to
ReportLayoutStyleTemplate and type Assets for the Title property.
- In
Model Editor, expand the AutoDesign1 node, and then select the node for
the DetailsList data region.
- In
the Properties window, set the style template to ListStyleTemplate and
type Asset details for the Title property.
To create a parameter that will be used to pass
data to the drillthrough report
- In
Model Editor, right-click the Parameters node for the AssetDetails report,
point to Add, and then click Parameter.
- Select
the node for the parameter.
- In
the Properties window, set the Data Type property to String, type
SelectedAssetID for the Name property, and type Asset ID: for the Prompt
String property.
To define a filter for the drillthrough report
- In
the AssetDetails design, right-click the node for the DetailsList data
region, point to Add, and then click Filter.
- Select
the node for the filter.
- In
the Properties window, specify =Fields!AssetId.Value for the Expression
property, specify Equals for the Operator property, and specify
=Parameters!SelectedAssetID.Value for the Value property.
To add a report drill through action
- In
Solution Explorer, double-click AssetList to open the model in Model
Editor.
- Expand
the Designs node for the AssetList report, expand the AutoDesign1 node,
expand the node for the AssetsTable data region, and then expand the Data
node.
- Right-click
the Name node, point to Add, and then click Report Drill Through Action.
- Select
the node created for the report drill through action.
- In
the Properties window, click the ellipsis button (…) for the Report Design
property. A dialog box displays.
- In
the dialog box, expand the AssetDetails report, select the AutoDesign1
node for that report, and then click OK.
Note:-
|
After you select a design, the parameters for the
drillthrough report display below the node for the drill through action in
Model Editor.
|
- In
Model Editor, select the node for the SelectedAssetID parameter that is
located below the node for the drill through action.
- In
the Properties window, specify =Fields!AssetId.Value for the Value
property.
- In
Model Editor, select the node for the AX_CompanyName parameter that is
located below the node for the drill through action.
- In
the Properties window, specify =Parameters!AX_CompanyName.Value for the
Value property.
To preview the drillthrough report
- In
Model Editor, right-click the AutoDesign1 node for the AssetList report,
and then click Preview. The AssetList report displays.
- You will see links in the report that indicate the drillthrough was created but you must verify the link to the report detail in the client.
Comments
Post a Comment