List of functions used in Dynamics AX 2012 SSRS Reports Expressions

During working in SSRS reports I have to handle division by Zero error for calculating accumulated cost by dividing Amount by Quantity.

 

This expression works for me.

 

IIf(Sum(Fields!xyz.Value) = 0, “N/A”, Sum(Fields!abc.Value) / IIf(Sum(Fields!abc.Value) = 0, 1,Sum(Fields!xvz.Value)))

I did little research on Expressions and function used in these SSRS expressions

 

 

Expressions:

Expressions are used for manipulate or update the value, for example, cost show by dividing amount by Quantity. Rounding of decimal. Similarly Expression can be used to highlight the filed if condition meets. Style font can be changed, even you can uses switch statement, to change the display value of report.

 

Types of Expressions

Globals
Operators – Arithmetic, Comparison, Logical
Common Functions – Text, Date & Time, Math, Inspection, Program Flow, Aggregate, Financial, Conversion, Miscellaneous

We can see each and every one very detail in following.

 

 

Globals

Global expressions executes/works in Page Header and Footer parts only.

ExecutionTime shows date and time at when report executes
PageNumber shows page number of each and every page but allowed only in page header and footer
ReportName displays name of the active report what name we have assigned to the active report
UserId shows current user name like company/alirazazaidi
Language displays language like US-English…

Operators

Arithmetic
^ power of
* multiplication
/ divides two numbers and returns a floating point result
\ divides two numbers and returns a integer result
Mod divides two numbers and returns remainder only
+ adds two numbers and concatenation for two strings
 subtraction and indicates negative value for numeric values
Comparison
Known operators : < <= > >= <> 
Like compares two strings and return true if matched or else returns False. Ex: =Fields!Title.Value Like Fields!LoginID.Value
Is compare two object reference variables Ex: = Fields!Title.Value Is Null
Concatenation
+ and & symbols uses for concatenation
Logical
Known: And, Not, Or 
Xor SELECT * FROM users where firstname = ‘Larry’ XOR lastname = ‘Smith’
AndAlso First condition will check first and if it is true only, goes to next or else it won’t need to check. Because our execution time is saving in a logical operation in which more conditions is combined using AndAlso function.
OrElse same like above

Common Functions

Text

Asc, AscW returns an integer value represents character code corresponding to a character

Chr, chrw returns the character associated with the specified character code

Filter =Filter(Fields!Title.Value,”Pr”,true,0

Format
=Format(Fields!Price.Value, “#,##0.00”), Format(Fields!Date.Value, “yyyy-MM-dd”)

FormatCurrency =formatcurrency(Fields!SickLeaveHours.Value,3)

FormatDateTime =FormatDateTime(Fields!BirthDate.Value,Integer)
Examples:
0 returns 10/10/2014
1 returns Friday, October 10, 2014
2 returns 6/3/2014
3 returns 12:00:00AM
4 returns 00:00

FormatNumber =FormatNumber(Fields!EmployeeID.Value,2)
Examples: 4.00

FormatPercent =”Percentage : ” & formatpercent(Fields!SickLeaveHours.Value)

GetChar =GetChar(Fields!Title.Value,5)

InStr =InStr(Fields!Title.Value,”a

InStrRev =Instrrev(Fields!Title.Value,”a

LCase Change strings into lower case
=Lcase(Fields!Title.Value)

Left Returns left side characters from a string
=Left(Fields!Title.Value,4)

Len Finds length of a string
=Len(Fields!Title.Value)

LSet Returns some length of a string from left
=Lset(Fields!Title.Value,5)

LTrim Trim left side of a string
=Ltrim(” “&Fields!Title.Value)

Mid Returns characters from the mentioned starting position
=Mid(Fields!Title.Value,InSTrRev(Fields!Title.Value,”T

Replace Replaces one string with another
=Replace(Fields!Title.Value,”a”,”A

Right Returns right side characters from a string
=Right(Fields!Title.Value,10)

RSet Returns some length of a string from left
=Rset(Fields!Title.Value,5)

RTrim Trim left side of a string
=Rtrim(Fields!Title.Value & ” “)

Space Specifies some spaces within strings
=Fields!Title.Value & Space(5) & Fields!Title.Value

StrComp Returns a value indicating the result of a string comparison

vbBinaryCompare 0 Perform a binary comparison.
vbTextCompare 1 Perform a textual comparison.
string1 is less than string2 -1
string1 is equal to string2 0
string1 is greater than string2 1
string1 or string2 is Null Null

StrConv
=Strconv(Fields!Title.Value,vbProperCase)
=Strconv(Fields!Title.Value,vbLowerCase)
=Strconv(Fields!Title.Value,vbUpperCase)

StrDup Returns a string or object consisting of the specified character repeated the specified number of times.
=StrDup(3,”M”)

StrReverse =StrReverse(Fields!Title.Value)

Trim =Trim(” “& Fields!Title.Value & ” “)

UCase =Ucase(Fields!Title.Value)

Date & Time

CDate Converts a object into date format
=Format(CDate(Fields!BirthDate.Value),”MMMM”)

DateAdd Returns a datetime that is the result of adding the specified number of time interval units to the original datetime.

=dateadd(“m”,12,Fields!BirthDate.Value)

DateDiff Find number of days, months and years between two dates
=datediff(“d”,Fields!BirthDate.Value,Now)

DatePart DatePart(DateInterval.Weekday, CDate(“2009/11/13”), FirstDayOfWeek.Monday) returns 5 (Friday)

DateSerial for first day of the month
=DateSerial(Year(Now), Month(Now), 1)
for the last day of the month
=DateSerial(Year(Now), Month(Now)+1, 0)

DateString Returns string value of system date
=datestring()

DateValue Returns current date

Day Returns day value from date
=day(Fields!BirthDate.Value)

FormatDateTime =FormatDateTime(Fields!BirthDate.Value,Integer)
Examples:
0 returns 6/3/2014
1 returns Friday, June 03, 2014
2 returns 6/3/2014
3 returns 12:00:00AM
4 returns 00:00

Hour =Hour(Fields!BirthDate.Value)

Minute =Minute(Fields!BirthDate.Value)

Month =Month(Fields!BirthDate.Value)

MonthName =MonthName(Month(Fields!BirthDate.Value))

Now Indicates current month
=Now() or =Now

Second =Second(Fields!BirthDate.Value)

TimeOfDay =TimeOfDay()
Returns a date value containing the current time of day according to your system

Timer =Timer()
Returns number of seconds elapsed since midnight

TimeSerial =TimeSerial(24,60,60)
Returns a date value representing a specified hour, minute and second

TimeString =TimeString()
Returns string value representing the current time of day according to your system

TimeValue Returns a date value set to jan 1 of year 1
=TimeValue(Fields!BirthDate.Value)

Today Returns Current date

Weekday Returns an integer value representing day of week
=WeekDay(Fields!BirthDate.Value)

WeekdayName =WeekdayName(Weekday(Fields!BirthDate.Value))
Returns name of the day of week

Year =year(Fields!BirthDate.Value)
Returns year of specified date

Math

Abs Returns the absolute value
=Abs(-2.36)

BigMul Returns multiplication value of two specified numbers
=BigMul(2,3)

Ceiling Returns next highest value
=Ceiling(2.67)

Cos
=Cos(2.33)
Returns cos value for specified number

Cosh
Returns hyperbolic cos value
=Cosh(2.33)

DivRem
=DivRem(23,2,5)

Fix
=Fix(23.89)
Returns integer portion

Floor
=Floor(24.54)
Returns largest integer

Int
=Int(24.78)
Returns integer portion of a number

Log
=Log(24.78)
Returns logarithm value

Log10
=Log10(24.78)
Returns the base 10 logaritm value

Max
=Max(Fields!EmployeeID.Value)
Returns larger value in the specified values

Min
=Min(Fields!EmployeeID.Value)
Returns smaller value in the specified values

Pow
=Pow(Fields!EmployeeID.Value,2)
Returns power of value for specified number

Rnd
=Rnd()
Returns a random number

Round
=Round(43.16)
Returns rounded value to the nearest integer

Sign
=Sign(-34534543)

Sin
=Sin(Fields!EmployeeID.Value)
Returns the sin value

Sinh
=Sinh(Fields!EmployeeID.Value)
Returns the hyperbolic sin value

Sqrt
=Sqrt(Fields!EmployeeID.Value)
Returns square root value

Tan
=Tan(Fields!EmployeeID.Value)
Returns the tan value

Tanh
=Tanh(Fields!EmployeeID.Value)
Returns the hyperbolic tan value

Inspection
IsArray
=IsArray(Fields!EmployeeID.Value)
Returns a boolean value indicating whether the specified object is array or not

IsDate
=IsDate(Fields!BirthDate.Value)
Returns a boolean value indicating whether the specified object is Date or not

IsNothing
=IsNothing(Fields!EmployeeID.Value)
Returns a boolean value depends on specified object is Nothing or not

IsNumeric
=IsNumeric(Fields!EmployeeID.Value)
Returns a boolean value depends on specified object is Numeric value or not

Program Flow

Choose
=CHOOSE(3, “Red”, “Yellow”, “Green”, “White”)
Returns a specific value using index in a list of arguments

IIf
=IIF(Fields!EmployeeID.Value>10,”Yes”,”No
Returns any one value depends on condition

Switch
=Switch(Fields!EmployeeID.Value<10,”Red
Fields!EmployeeID.Value>10,”Green
Evaluates list of expressions

Aggregate

Avg
=Avg(Fields!EmployeeID.Value)
Returns average value for all specified values

Count
=Count(Fields!EmployeeID.Value)
Returns count of all specified values

CountDistinct
=CountDistinct(Fields!EmployeeID.Value)
Returns count of all distinct values

CountRows
=CountRows()
Returns count of rows

First
=First(Fields!EmployeeID.Value)
Returns first for all specified values

Last
=Last(Fields!EmployeeID.Value)
Returns last for all specified values

Max
=Max(Fields!EmployeeID.Value)
Returns max for all specified values

Min
=Min(Fields!EmployeeID.Value)
Returns min for all specified values

StDev
=StDev(Fields!EmployeeID.Value)
Returns standard deviation value

StDevP
=StDevP(Fields!EmployeeID.Value)
Returns Population standard deviation value

Sum
=Sum(Fields!EmployeeID.Value)
Returns sum of all values

Var
=Var(Fields!EmployeeID.Value)
Returns variance of all values

VarP
=Var(Fields!EmployeeID.Value)
Returns population variance of all values

RunningValue
=RunningValue(Fields!EmployeeID.Value,sum,nothing)
Returns running aggregate of the specified
expression

Financial

DDB DDB (Double Declining Balance) method computes depreciation of an asset for a specified period.
Syntax: DDB (Cost, Salvage, life, period, factor)

FV FV (Future Value) of an investment based on periodic, constant payments and a constant interest rate.
Syntax: FV (rate, nper, pmt, pv, type)

IPmt IPmt (Interest Payment) for a given period for an investment based on periodic, constant payment and a constant interest rate
IPMT (rate, per, nper, pv, fv, type)

IRR IRR (Interest Rate of Return) for a series of cash flows represented by the numbers in values.
IRR(values,guess)

MIRR MIRR ( Modified internal rate of return ) for a series of periodic cash flows
MIRR(values,finance_rate,reinvest_rate)

NPer Returns the number of periods for an investment based on periodic, constant payments and a constant interest rate.
NPER (rate, pmt, pv, fv, type)

NPV Calculates the net present value of an investment by using a discount rate and a series of future payments (negative values) and income (positive values).
Syntax: NPV(rate,value1,value2, …)

Pmt Calculates the payment for a loan based on constant payments and a constant interest rate.
PMT(rate,nper,pv,fv,type)

PPmt Returns the payment on the principal for a given period for an investment based on periodic, constant payments and a constant interest rate.
PPMT(rate,per,nper,pv,fv,type)

PV Returns the present value of an investment. The present value is the total amount that a series of future payments is worth now. For example, when you borrow money, the loan amount is the present value to the lender.
PV(rate,nper,pmt,fv,type)

Rate Returns the interest rate per period of an annuity. RATE is calculated by iteration and can have zero or more solutions.
RATE(nper,pmt,pv,fv,type,guess)

SLN Returns the straight-line depreciation of an asset for one period.
SLN(cost,salvage,life)

SYD Returns the sum-of-years’ digits depreciation of an asset for a specified period.
SYD(cost,salvage,life,per)

Conversion

CBool Convert to boolean
=CBool(fields!EmployeeID.Value)
CByte Convert to byte
CChar Convert to char
CDate Convert to date
CDbl Convert to double
CDec Convert to decimal
CInt Convert to integer
CLng Convert to long
CObj Convert to object
CShort Convert to short
CSng Convert to single
CStr Convert to string
Fix =Fix(32.342143)
Returns integer portion of a number
Hex =Hex(Fields!EmployeeID.Value)
Returns a hexadecimal value of a number
Int =Int(43.44)
Returns integer portion of a number
Oct =Oct(Fields!EmployeeID.Value)
Returns a octal value of a number
Str =Str(Fields!EmployeeID.Value)
Returns string value of a number
Val =Val(“32.43”)
Returns numeric value in string format

Miscellaneous

Previous =Previous(Fields!EmployeeID.Value)
Returns the previous value

 

Convert Number to Words in SSRS Design Level

A question that is often asked is how to convert a number to words in SSRS. For example 1 => One.

Let’s take a look at an example:

SELECT Sales.SalesPerson.SalesPersonID AS SalesPerson,
SUM(Sales.SalesOrderDetail.OrderQty * Sales.SalesOrderDetail.UnitPrice) AS Amount
FROM Sales.SalesOrderDetail
INNER JOIN Sales.SalesOrderHeader ON Sales.SalesOrderDetail.SalesOrderID = Sales.SalesOrderHeader.SalesOrderID
INNER JOIN Sales.SalesPerson ON Sales.SalesOrderHeader.SalesPersonID = Sales.SalesPerson.SalesPersonID
GROUP BY Sales.SalesPerson.SalesPersonID

For the sake of example, let us assume that we need to display sales person id along with the sales amount and the amount in words.

Listed below are the basic steps to create the report:
1. Create a SSRS project
2. Add new report the project
3. Add a data source in which database is pointed to adventureworks
4. Create a data set with above querys
5. Drag and drop a table to layout from the toolbox and drag and drop the fields to the table

The next step is to create a function to convert the numeric values into words.

Go to Report menu option and select report properties. Select the Code tab in the dialog box and copy and paste the following code.

‘ adapted from
http://cc.msnscache.com/cache.aspx?q=72465960679242&mkt=en-US&lang=en US&w=577f5001&FORM=CVRE8
‘ drastically updated for .NET by LSN

SHARED suffixes AS String() = _
{“Thousand “, “Million “, “Billion “, “Trillion “, _
“Quadrillion “, “Quintillion “, “Sextillion “}

SHARED units AS String() = _
{“”,”One “, “Two “, “Three “, “Four “, “Five “, _
“Six “, “Seven “, “Eight “, “Nine “}

SHARED tens AS String() = _
{“Twenty “, “Thirty “, “Forty “, “Fifty “, “Sixty “, _
“Seventy “, “Eighty “, “Ninety “}

SHARED digits AS String() = _
{“Ten “,”Eleven “, “Twelve “, “Thirteen “, “Fourteen “, _
“Fifteen “, “Sixteen “, “Seventeen “, “Eighteen “, “Nineteen”}

SHARED expr AS NEW _
System.Text.RegularExpressions.Regex(“^-?d+(.d{2})?$”, _
System.Text.RegularExpressions.RegexOptions.None)

Public Function ExpandPrice(Price AS Double, Optional pSeparator AS String = “.”) AS String

Dim pPrice As String
pPrice = FORMAT(Price,”##############.00″)

Dim temp AS New System.Text.StringBuilder()
If Not expr.IsMatch(pPrice) Then
‘ temp.Append(pPrice) or whatever you want to do here
Else
Dim parts AS String() = pPrice.Split(pSeparator)
Dim dollars AS String = parts(0)
Dim cents AS String = parts(1)
If CDbl(dollars) > 1 Then
temp.Append(ExpandIntegerNumber(dollars) & “Dollars “)
If CInt(cents) > 0 Then
temp.Append(“And “)
End If

ElseIf CDbl(dollars) = 0 Then
temp.Append(ExpandIntegerNumber(dollars) & “Zero Dollars “)

If CInt(cents) >= 0 Then
temp.Append(“And “)
End If

ElseIf CDbl(dollars) = 1 Then

temp.Append(ExpandIntegerNumber(dollars) & “Dollar ” )

End If

If CDbl(cents) > 1 Then

temp.Append(ExpandIntegerNumber(cents) & “Cents”)

ElseIf CDbl(cents) = 0 Then

temp.Append(ExpandIntegerNumber(cents) & “Zero Cents “)

ElseIf CDbl(cents) = 1 Then

temp.Append(ExpandIntegerNumber(cents) & “Cent ” )

End If

End If

RETURN temp.ToString()

End Function

Function ExpandIntegerNumber(pNumberStr AS String) AS String

Dim temp2 AS New System.Text.StringBuilder()

Dim number AS String = _

StrDup(3 – Len(pNumberStr) Mod 3, “0″) & pNumberStr

Dim i AS Integer, j AS Integer = -1

Dim numPart AS String

For i = Len(number) – 2 To 1 Step -3

numPart = Mid(number, i, 3)

If Clng(numPart > 0) Then

If j > -1 Then

temp2.Insert(0,suffixes(j),1)

End If

End If

temp2.Insert(0,GetNumberUnder1000Str(numPart),1)

j += 1

Next

RETURN temp2.ToString()

End Function

Function GetNumberUnder1000Str(pNumber AS String) AS String

Dim temp1 AS New System.Text.StringBuilder()

If Len(pNumber) = 3 Then

If CLng(Left(pNumber, 1)) > 0 Then

temp1.Append(GetNumberUnder100Str(Left(pNumber, 1)) & “Hundred “)

End If

End If

temp1.Append(GetNumberUnder100Str(Right(“0″ & pNumber, 2)))

RETURN temp1.ToString()

End Function

Function GetNumberUnder100Str(pNumber AS String) AS String

If pNumber > 19 Then

RETURN tens(Left(pNumber, 1) – 2) & units(Right(pNumber, 1))

ElseIF pNumber >= 10 and pNumber <= 19 Then

RETURN digits(Right(pNumber, 1))

Else

RETURN units(Right(pNumber, 1))

End If

End Function

The above code is adapted from said web site, but I have mad some small changes to it.

Next, you have to call this function in your table list control of the report. You need to enter the following function call at the column in which you need to have your number displayed in words.

=Code.ExpandPrice(Fields!Amount.Value,”.”)

The report will be dispalyed as illustrated below:

Global::numeralsToTxt(12345.20);

About print management processing [AX 2012]

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

When you post or reprint business documents such as sales orders and purchase orders, the resulting documents, such as invoices or picking lists, can be printed by using the defined settings for the effective original or copy records in print management. The effective records are the original and copy records that apply to the document that is generated. This topic explains how Microsoft Dynamics AX determines which original records, copy records, and conditional settings are effective during the posting and printing process.

The print management setup information for each document type is defined in a hierarchical list that consists of modules, accounts, and transactions. At each level of the hierarchy, you can define print management original records, copy records, and settings for any of the available document types. When a document is generated, it is printed according to the effective original record and effective copy records. An effective record can be inherited from a higher level in the hierarchy or created as a new record for the current level in the hierarchy, or it can override an inherited record that has the same name.

Each original record or copy record can have a default setting associated with it, which specifies the footer text, printer destination, and number of identical copies to print. If the Default setting check box in the Print management setup form is selected, a document is printed according to the specifications for the default setting. If this check box is not selected, a document is printed only if a query for an associated conditional setting successfully returns results.

Each original record or copy record can have up to 19 conditional settings associated with it. Each conditional setting has a related query. When the document is generated during posting, the queries that are associated with the conditional settings are evaluated in the order in which the settings appear in the Print management setup form. The setting that is associated with the first successful query is used to print the document.

NoteNote
While conditional settings and queries provide flexibility in your print management settings, complex queries or many conditional settings can affect posting performance.

For more information about how original records, copy records, and conditional settings work together at the module and account levels, see the following examples. For this series of examples, print management is set up for free text invoice documents.

If you print a document to the screen, you can view up to five reports, each in a separate report window. For example, if you print customer statements to the screen, statements for only the first five customers are displayed. Additional reports are saved as PDF files in the location that is specified in the Directory field in the File store area of the System parameters form. (Click System administration > Setup > System parameters.)

You can set up print management for all free text invoices that are printed from the legal entity that you are logged on to. To do this, set up print management at the module level.

  1. From the Accounts receivable Form setup form, open the Print management setup form, expand the Free text invoice list in the left pane, and select the Original record.
  2. In the right pane, enter Original as the footer text.

For more information, see Set up print management for a module and Set up footer text for documents.

You likely will have to create a copy of each free text invoice to send to your customers, and you might want to include the words “Customer Copy” on those copies. To do this, you can set up print management at the module level.

  1. In the Print management setup form, right-click the Free text invoice document and select New. A new record is displayed in the list in the left pane.
  2. In the right pane, enter a name for the copy record, such as Customer Copy, and enter Customer Copy as the footer text.
The previous examples illustrate setting up print management at the module level, such as for Accounts receivable. By setting up print management at the module level, future maintenance of printer specifications is simplified. However, you might have customers who require special treatment with regard to their free text invoices. For example, you might want to print an additional copy of the free text invoice to send to your sales manager whenever an invoice is generated for a particular account. To do this, you can copy an inherited module-level copy record that contains the print management specification for the additional copy.

  1. Select a customer in the Customers form, and from that form, open the Print management setup form.
  2. Expand the Free text invoice list, right-click the copy record titled Customer Copy, and select Copy. A new copy record is created, which is effective only for the selected customer.
  3. Enter a name for the copy, such as Sales Manager Copy, and enter Sales Manager Copy as the footer text.

For more information, see Set up print management for a customer or vendor.

You might decide that for the same customer as in the previous example, the footer text should be “Preferred Customer Copy” instead of “Customer Copy.” To make this change, you can override an inherited copy record at the account level.

  1. Select a customer in the Customers form, and from that form, open the Print management setup form.
  2. Expand the Free text invoice list, right-click the copy record titled Customer Copy, and select Override. The icon next to the copy record in the list changes to indicate that the record has been overridden. The account-level record also has the name Customer Copy.
  3. Change the footer text to Preferred Customer Copy.
NoteNote
If you override an original record, copy record, or conditional setting and then change the parent record in the hierarchy, the changes to the parent record do not update the override records or settings that you created.

You can also override print management settings for individual transactions. For more information, see Set up print management for a transaction.

You might have a group of customers who are considered preferred customers. Instead of setting up print management at the account level for each customer, you can use conditional settings to print “Preferred Customer Copy” on documents for preferred customers and “Customer Copy” for all other customers. To do this, set up conditional settings at the module level.

  1. From the Accounts receivable Form setup form, open the Print management setup form.
  2. Expand the Free text invoice list, right-click the copy record titled Customer Copy, and select New. A conditional setting is displayed in the list.
  3. In the right pane, enter a description for the setting, such as Preferred Customers.
  4. Click Select, select the range of customers that includes your preferred customers, and then click OK.
  5. Enter Preferred Customer Copy as the footer text.

When you post free text invoices, the customer copy for customers who are included in the query results for the conditional setting will display “Preferred Customer Copy” as the footer text. The customer copy for all other customers will display “Customer Copy,” because that is the footer text that is associated with the default setting for the Customer Copy record.

You might use a custom report format for specific accounts. For example, you might have a format that includes more detailed line information when an invoice is generated for a specific account. To do this, you must have a developer create a custom report format and add it to the Application Object Tree (AOT). Then, you can create a copy record that contains the print management specification for the customer account.

  1. Select a customer in the Customers list or form, and from that list or form, open the Print management setup form.
  2. Expand the Free text invoice list, right-click the copy record titled Customer Copy, and select Copy. A new copy record is created, which is effective only for the selected customer.
  3. Enter a name for the copy, such as Custom Format Copy.
  4. Select a report format. The options in the list include custom reports that have been created by a developer and added to the AOT.
See also

  

About print management document types and modules [AX 2012]

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

Print management works with several modules. These include Accounts receivable, Accounts payable, and Project management and accounting. You can see the supported documents for each module in the Print management setup form. For example, in Accounts receivable, the following documents are supported:

  • Collection letter note
  • Confirmation
  • Customer account statement
  • Customer invoice
  • Free text invoice
  • Interest note
  • Quotation
  • Sales agreement confirmation
  • Sales order confirmation
  • Sales order packing slip
NoteNote
The Confirmation and Quotation document types are also used in Sales and marketing.

You can set up print management original records, copy records, and conditional settings at the module, account, or transaction level.

Setting up print management at the module level requires the least amount of setup and minimizes the maintenance work when you have to change the settings, such as when you install new printers or change your existing printers. However, if your business needs require it, you can override the module settings for specific accounts or individual transactions.

NoteNote
If you set up print management at the account or transaction level, the setup information will be more complex to manage when you add or change printers because you will have to change the settings for each individual account or transaction.
Print management support for documents in the Print management setup form is controlled by the following configuration keys.

Module and configuration key Document type
Accounts receivable

Quotations (QuotationBasic)

Trade (LogisticsBasic)

Confirmation

Quotation

Accounts receivable

Trade (LogisticsBasic)

Customer invoice

Sales order confirmation

Sales order packing slip

Accounts receivable

General ledger (LedgerBasic)

Customer account statement

Free text invoice

Accounts receivable

Collection letter (CustCollectionLetter)

Collection letter note
Accounts receivable

Interest (CustInterest)

Interest note
Accounts receivable

Purchase and Sales Agreement (TradeBlanketOrder)

Sales agreement confirmation
Accounts payable

Trade (LogisticsBasic)

Purchase order

Purchase order product receipt

Purchase order receipts list

Request for quotation

Request for quotation – accept

Request for quotation – reject

Request for quotation – return

Vendor invoice

Accounts payable

Purchase and Sales Agreement (TradeBlanketOrder)

Purchase agreement confirmation
Project management and accounting

Project (ProjBasic)

Project invoice
Inventory and warehouse management

Trade (LogisticsBasic)

Picking list

Dynamics AX 2012 Reporting: How to specify new design for Sales order confirmation

Sales order confirmation report is one of the special reports which are manage by print management. When we create new design in Visual Studio for out Sales order confirmation report and we want to use it it is not enough to change the code. Even those we will change the code in class AOT\Class\SalesConfirmationController method main from:

controller.initArgs(_args,ssrsReportStr(SalesConfirm,Report)

to

controller.initArgs(_args,ssrsReportStr(SalesConfirm,Report_NewDesign)

that will not be picked up and sales confirmation will be still printed in old design.

To change the design you need to:

If you go to

Account receivable > Setup > Forms > Form setup

Click on button Print management

You will see that by default report format is set up to: SalesConfirm.Report

If you want to use every time your new design then you can select for Report format your desire design.

If your desire format does not appear in drop down list you will need to edit method populate of table PrintMgmtReportFormat http://msdn.microsoft.com/en-us/library/printmgmtreportformat.populate.aspx

You can do it in following way:

// Add additional custom report formats here..// Here is an example:

addOther(PrintMgmtDocumentType::SalesOrderConfirmation, ‘SalesConfirm.Report_NewDesignA’, ‘SalesConfirm.Report_NewDesignA’, #NoCountryRegionId);

then when you open again Print management form the report name will be available in drop down.

If you want to use the design only in some cases then you can use procedure describe here: http://technet.microsoft.com/en-us/library/dd309660.aspx (section: Specify conditional settings for an original or copy record)

To learn more about print management

http://technet.microsoft.com/en-us/library/dd309615.aspx

http://technet.microsoft.com/en-us/library/dd309745.aspx