Book Image

Developing SSRS Reports for Dynamics AX

By : Mukesh Hirwani
Book Image

Developing SSRS Reports for Dynamics AX

By: Mukesh Hirwani

Overview of this book

<p>SQL Server Reporting Services is the primary reporting platform for Microsoft Dynamics AX. Nowadays every business demands reports ranging from showing an aggregate view of their business performance to the transactional data formatted in a way that can be easily filtered, printed, and emailed. SQL Server Reporting Services allows you to do all this and more, quickly and easily.</p> <p>Developing SSRS Reports for Dynamics AX 2012 covers all the technical aspects of AX 2012 reporting, taking you through various step-by-step guides to quickly develop reports. It encapsulates various real-time scenarios and walkthroughs which will guide you step-by-step to develop reports. You will then go on to learn about various performance-related measures to help you develop or customize reports for Dynamics AX 2012 more efficiently.</p> <p>Developing SSRS Reports for Dynamics AX 2012 is completely based on Microsoft Dynamics AX 2012 report development. Developing SSRS Reports for Dynamics AX has been written in a way to make reporting complex components quicker and easier. You will come across day-to-day scenarios to perform report development.</p> <p>Learn various mechanisms of developing reports in Visual Studio for Dynamics AX 2012. Develop reports using various types of data sources like AOT Query, external data source, and Report Data Provider class. You will also learn various performance enhancement techniques that will help you to manage complex reporting requirements.</p>
Table of Contents (17 chapters)
Developing SSRS Reports for Dynamics AX
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Common SSRS Expressions
Index

String functions


A list of common string functions is given in the following table:

No

Function name

Description

Syntax

1

GetChar

This function returns a specific character from the string.

=GetChar(StringValue,Position)

For Example:

GetChar("Red",2)

Returns:

e

2

InStr

This function returns the starting position of the first occurrence of one string within another.

=InStr(StringValue1,StringValue2)

For Example:

InStr("My Car is Red","Car")

Returns:

4

3

LCase

This function converts a string to lower case.

=LCase(StringValue)

4

UCase

This function converts a string to upper case.

=UCase(StringValue)

5

StrReverse

This function reverses the string.

=StrReverse(StringValue)

6

Mid

This function gets a character from the middle of the string.

=Mid(StringValue, StartPosition, No ofchar)

For Example:

Mid("Car",2,1)

Returns:

a

7

Replace

This function replaces a string value with another string value.

=Replace(StringValue,FindString,ReplaceString)

8

Space

This function adds spaces.

=Space(No of spaces)

A list of common date functions are described in the following table:

No

Function name

Description

Syntax

1

today

This function is used to return today's date.

=today()

2

DateAdd

This function is used to add values to the date; we can add the number of days, months, and year. We can use intervals as the following values:

  • d: Day

  • m: Month number

  • q: Quarter

  • yyyy: Year

  • h: Hour

  • n: Minutes

  • s: Seconds

=DateAdd(DateInterval, Number, DateValue)

For Example:

=DateAdd("m",1,today())

3

DateDiff

This function is used to get the difference between two dates. We can get the difference in terms of days, months, years, and so on. Refer to the interval as explained in the DateAdd function.

=DateDiff(DateInterval, DateValue,DateValue)

4

monthName

This function returns the month name.

=monthName(MonthNumber,Abbreviate)

5

WeekdayName

This function returns the name of the weekday. It will generally start as 1 for Sunday, 2 for Monday, and will go up to 7, that is Saturday.

=WeekdayName(DayNumber, Abbreviate)

6

First day of current week

This function returns the first day of the current week.

=DateAdd("d",-DatePart("w",Today,0,0)+1,Today)

7

Last date of month

This function will return the last day of the month.

=DateAdd("d",-1,cdate("3/1/2013"))

8

DatePart

This function will return a specific value from the date. Refer to the interval as explained in the DateAdd function.

=DatePart(DateInterval,DateValue)

A list of common format functions is given in the following table:

No

Function name

Description

Syntax

1

Change color of textbox

This function allows changing the color of the text box based on a value.

For Example:

=IIf(Fields!ProfitPercent > 70, Green, Red)

2

Currency

This function converts the real value to a currency.

For Example:

=Format(1223321,"C")

3

Number

This function converts the value to a number.

For Example:

=Format(1223321,"N1")

Returns:

1223321.0

4

FormatDateTime

This function converts thedate and time format to the required format.

For Example:

=FormatDateTime(Date.Value,1)
=FormatDateTime(Date.Value,2)
=FormatDateTime(Date.Value,3)
=FormatDateTime(Date.Value,4)

Returns:

Thursday, July 12, 2013
7/12/2013
12:00:00AM
00:00

5

Format

This function converts a date value to a required format. We can use the following format descriptions for the date:

  • dd: Day of month

  • ddd: Day of week (Abbreviate)

  • dddd: Day of week (Full name)

  • MMM: Month name (Abbreviate)

  • MMMM: Month name (Full name)

  • y: Year (Last 1 or 2 digit)

  • yy: Year (Last 2 digit)

  • yyyy: Year

For Example:

=Format(Date.Value,"dd-MM-yyyy")

Returns:

12-07-2013

A list of common global functions is described in the following table:

No

Function name

Description

Syntax

1

Execution time

This functions returns the time when the report runs.

=Globals!ExecutionTime

2

Page number

This function returns the current page number.

=Globals!PageNumber

3

Report folder

This function returns the full report path (physical location not Report Server URL).

=Globals!ReportFolder

4

Report name

This function returns the report name.

=Globals!ReportName

5

Report server URL

This function returns the Report Server URL where the report is executed.

=Globals!ReportServerUrl

6

Total pages

This function returns the total pages in the report.

=Globals!TotalPages

7

User Id

This function returns the current User ID who is running the report.

=User!UserID

8

Language

This function returns the current language in which the report is rendered.

=User!Language