0% found this document useful (0 votes)
57 views

Column Chart Report

This document provides instructions for creating a column chart report in Microsoft Dynamics AX to display customer transaction data. It describes defining a query to retrieve the data, creating a reporting project in Visual Studio, building a report with a column chart visualization populated from the query data, and adding parameters and filters to allow customizing the data displayed in the report.

Uploaded by

kasim
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views

Column Chart Report

This document provides instructions for creating a column chart report in Microsoft Dynamics AX to display customer transaction data. It describes defining a query to retrieve the data, creating a reporting project in Visual Studio, building a report with a column chart visualization populated from the query data, and adding parameters and filters to allow customizing the data displayed in the report.

Uploaded by

kasim
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Walkthrough1: Creating a Column Chart Report

A chart provides a graphical representation of data. Displaying data in a chart makes it easy for users to
see comparisons, patterns, and trends in the data. In this walkthrough, you will create a report to display
customer transaction data in a column chart.

This walkthrough illustrates the following tasks:

 Defining a query
 Creating a reporting project
 Creating a report with a column chart
 Creating and configuring report parameters and filters
 Applying layout and style templates
 Changing the format to a bar or line chart

Prerequisites

To complete this walkthrough, you will need:

 Microsoft Dynamics AX with sample data

Note

This walkthrough uses the CustTable, CustTrans, and CustGroup tables. In order to view
data in the report, these tables must be populated with data.

 Microsoft SQL Server 2008


 Microsoft Visual Studio 2010
 Microsoft Visual Studio tools for Microsoft Dynamics AX

Defining a Query

There are several ways to retrieve data for reports. In this walkthrough, you will use a query that is defined
within the Microsoft Dynamics AX development environment. You will create a query using
the CustTable table as the data source. In the report, you will filter the data that is displayed based on
the TransType field that is from the CustTrans table so you will add the CustTrans table as a data source.
The following procedure explains how to define the query that will be used to retrieve customer
transaction data.

1
Source: http://msdn.microsoft.com/en-us/library/cc554854.aspx
To define a query

1. Open the Microsoft Dynamics AX Development Workspace.


2. In the AOT, right-click the Queries node, and then click New Query.
3. Right-click the node for the query, click Rename, and then type CustTransactionData. Expand the
node for the CustTransactionData query.
4. Right-click the Data Dictionary node, and then click Open New Window.
5. In the new window, expand the Tables node.
6. Locate the CustTable table and drag it onto the Data Sources node for the query.
7. In the CustTable_1 data source node, select the Fields node, in the Properties window, set
the Dynamicproperty to Yes.
8. Locate the CustTrans table and drag it onto the Data Sources node located below
the CustTable data source.
9. In the CustTrans_1 data source node, select the Fields node, in the Properties window, set
the Dynamicproperty to Yes.
10. Right-click the Relations node for the CustTrans data source, and then click New Relation.
11. Select the node for the relation and verify the following default values in the Properties window.

Property Value
JoinDataSource CustTable_1

Field AccountNum

Related Field AccountNum

12. In the AOT, right-click the Ranges node for the CustTrans data source, and then click New
Range.
13. Select the node for the range, and in the Properties window, select the TransType field from the
drop-down menu for Field.

Note

A report parameter is automatically generated for the range when the query is used in a
report dataset and the Dynamic Filters property is set to False.

14. The TransType field is an enum type. When you define the report, you must know the value of
theEnumType property when you define the AX Enum Provider data source. To find the property
value, in the AOT, click Data Dictionary > Tables > CustTrans > Fields > TransType. In the
Properties window, note that the EnumType property is set to LedgerTransType.
15. Locate the CustGroup table and drag it onto the Data Sources node located below
the CustTrans data source.
16. In the CustGroup_1 data source node, select the Fields node, in the Properties window, set
theDynamic property to Yes.
17. Right-click the Relations node for the CustGroup data source, and then click New Relation.
18. Select the node for the relation and specify the following values in the Properties window.

Property Value
JoinDataSource CustTable_1

Field CustGroup

Related Field CustGroup

19. Save the query.

Creating a Reporting Project

Next, you will create a reporting project in Microsoft Visual Studio. When you create an Microsoft
Dynamics AX project, you can choose from two project templates: Report Model and EP Web
Application. In this walkthrough, you will use the Report Model template.

To create a reporting project

1. Open Microsoft Visual Studio.


2. On the File menu, point to New, and then click Project. The New Project dialog box displays.
3. In the Installed Templates pane, click Microsoft Dynamics AX node, and in
the Templates pane, clickReport Model.
4. In the Name box, type SampleChartReport, and in the Location box, type a location.
5. Click OK.

Creating a Report with a Column Chart

Before you create a chart, you need to decide what type of chart to create. There are two types of
charts: XY charts and pie or doughnut charts. An XY chart is a column, line, or bar chart. During design, you
can switch between related chart types. For example, you can create a column chart and then later change
it to a bar or line chart. In this walkthrough, you will begin by creating a column chart. Later in the
walkthrough, you will change the design so that the data displays in a bar chart and then in a line chart.

To create a report with a column chart

1. In Solution Explorer, right-click the SampleChartReport project, point to Add, and then
click Report.
2. In Model Editor, right-click the Report1 node, and then click Rename.
3. Type ColumnChartReport as the name.
4. Expand the ColumnChartReport node if it is not already expanded.
5. Right-click the Datasets node, and then click Add Dataset.
6. Select the node for the dataset.
7. In the Properties window, specify the following values.

Property Value
Data Dynamics AX
Source

Data Query
Source
Type

Default ColumnChart
Layout

Dynamic False
Filters

Name CustomerTransactions

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 theCustTransactionData query. Expand the CustTrans > All
Fields node. Select the TransDateand AmountMST fields. Expand
the CustGroup > All Fields node and select the Namefield.

8. In Model Editor, expand the node for the CustomerTransactions dataset if it is not already
expanded.
9. Select the AmountMST field, and in the Properties window, set the Aggregate
Function property toSum and the Format String property to Currency.
10.
11. Right-click the Datasets node, and then click Add Dataset. You will create an dataset with an AX
Enum Provider data source for the TransType enum field. This will allow you to filter the report to
show specific transaction types.
12. Select the node for the dataset.
13. In the Properties window, specify the following values.

Property Value
Data Source Dynamics AX

Data Source Type AX Enum Provider

Default Layout Table


Dynamic Filters False

Name LedgerTransTypeEnum

Query LedgerTransType

14. Drag the CustomerTransactions node onto the Designs node for the report. An auto design
calledAutoDesign1 is created for the report.
15. Expand the AutoDesign1 node, expand the node for the chart data region, and then expand
the Datanode.
16. Drag the Name field to the Categories node.
17. Drag the TransDate field to the Series node.

Note

The AmountMST field should be the only field that remains below the Data node.

18. Select the node for the TransDate series.


19. In the Properties window, type =Year(Fields!TransDate.Value) for the Label property.
20. In Model Editor, expand the node for the TransDate series, expand the GroupOn node, and then
select the TransDate node that is located below the GroupOn node.
21. In the Properties window, type =Year(Fields!TransDate.Value) for the Expression property.

Creating and Configuring Report Parameters and Filters

Next, you will create and configure several parameters and filters for the report. The report already
contains a parameter for the TransType field since a range based on this field was added to the query
when it was defined in the AOT and you set the Dynamic Filters property for the data set to False. You
will add some additional parameters to allow users to specify the to date and from date. After you have
created the parameters, you will create filters to filter the data based on the range specified by the user.
The following procedure explains how to create and configure the report parameters and filters.

To create and configure report parameters and filters

1. In Model Editor, expand the Parameters node, and then select


the CustomerTransactions_TransTypeparameter.
2. In the Properties window, set the following property values:

Property Value
Allow Blank False
Data Type Integer

Default 2
Value
This will display only the Sales order transactions on the report.

Values Click the ellipsis button (...) to open the Select Values dialog box. Set the
following values:
 Dataset: LedgerTransTypeEnum
 Value field: Value
 Label field: Label

Visibility Hidden

3. This will limit the query to return only sales invoice transactions and hide the parameter so that it
does not display to the users.
4. In Model Editor, right-click the Parameters node and then click Add Parameter.
5. Select the node for the parameter.
6. In the Properties window, specify the following values.

Property Value
Data Type DateTime

Name FromDate

Prompt String From date:

7. In Model Editor, right-click the Parameters node and then click Add Parameter.
8. Select the node for the parameter.
9. In the Properties window, specify the following values.

Property Value
Data Type DateTime

Name ToDate

Prompt String To date:

10. In Model Editor, expand the Designs node, expand the AutoDesign1 node, and then expand the
node for the chart data region.
11. Right-click the Filters node, and then click Add Filter.
12. Select the node for the filter.
13. In the Properties window, specify the following values.

Property Value
Expression =Fields!TransDate.Value

Name FromDateFilter

Operator GreaterThanOrEquals

Value =Parameters!FromDate.Value

14. In Model Editor, right-click the Filters node, and then click Add Filter.
15. Select the node for the filter.
16. In the Properties window, specify the following values.

Property Value
Expression =Fields!TransDate.Value

Name ToDateFilter

Operator LessThanOrEquals

Value =Parameters!ToDate.Value

Applying Layout and Style Templates

Next, you will specify layout and style templates for the report. A layout template defines the general
layout and style settings for a report. A style template contains the layout and style settings for a data
region that displays in the body of a report. You will apply the predefined templates that provided by the
Microsoft Dynamics AX framework. These templates are the standard templates for Microsoft Dynamics
AX reports. The following procedure explains how to apply layout and style templates to the report.

To apply layout and style templates

1. In Model Editor, select the AutoDesign1 node.


2. In the Properties window, set the LayoutTemplate property to ReportLayoutStyleTemplate.
Also, typeCustomer transactions for the Title property.
3. In Model Editor, expand the AutoDesign1 node, and then select the node for the chart data
region.
4. In the Properties window, set the Style Template property to ColumnChartStyleTemplate.
5. Delete the default text for the Title property so that it does not display a title for the data region.
6. Set the Value Axis Data Scale Minimum property to 5. This will set the starting value on the axis
of your report to 5 instead of 0. This is one of many properties that will define the look of your
report.
7. In Model Editor, right-click the AutoDesign1 node, and then click Preview to view the report.
Specify dates for the parameters, and then click the Report tab to view the report.
8. Close the Preview window.

Changing the Format to a Line or Bar Chart

During design, you can switch between several related chart types. First, you will switch from a column
chart to a bar chart. After that, you will switch it to a line chart. The following procedures explain how to
switch between chart types.

To switch the format to a bar chart

1. In Model Editor, select the node for the CustomerTransactionsXYChart chart data region.
2. In the Properties window, set the Chart Type property to Bar.
3. From the Model Editor toolbar, click Preview.

To switch the format to a line chart

1. In Model Editor, select the node for the CustomerTransactionsXYChart chart data region.
2. In the Properties window, set the Chart Type property to Line.

Click the tab for the Preview window to view the changes.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy