By using this website, you agree to our Terms of Use (click here)
The Format function in Report Designer is pretty flexible, but not that intuitive.
Here are a couple of examples from the Sales Order (SO641010) report to help get you started.
Example #1
Format('{0} {1}', [SOLine.InventoryID], '{br}'+[SOLine.TranDesc])
You can see that the first argument to the Format function is a string: '{0} {1}'
In this string, the {0} and {1} are placeholders telling the function that the values will come as the next two arguments to the Format function.
In the last argument you can see that {br} is used which simply tells it to print a new line.
The printed result will be SOLine.InventoryID on one line and SOLine.TranDesc on the second line.
You could also do something like this which would print SOLine.InventoryID, then a colon, then a space, then SOLine.TranDesc:
Format('{0}: {1}', [SOLine.InventoryID], [SOLine.TranDesc])
Example #2
=Format('{0:0.00}', Round([SOLine.OrderQty],1))
In this example the string in the first argument includes a format code about how to format the second argument.
The first 0 in {0:0.00} is the argument number which grabs this value: Round([SOLine.OrderQty],1)
The 0.00 in {0:0.00} is how the argument should be formatted.
There's a nice formatting section in the S130 Course on Acumatica University showing the various formatting codes (for numbers, dates, etc.) that can be used.
Example #3
=Format('Last Sale on {0:MM/dd/yyyy}',[SOOrder.OrderDate])
This is the same as Example #2 in that we're formatting the value, but now I've added additional text around the value.
Also, I wanted to show an example of formatting a Date field.
I am running into errors with the format formula below. Does anyone have any tips on how to get this to work? I want the format to be $7.44 and without any formatting its 7.4400. I input $#,##0.00 in the format field in properties and it didn't work.
=IIf([PMTaxTran.TaxID]='MIL COUNTY SALES TAX',[PMTaxTran.TaxID_description]+':'+ Format('{$#,##0.00}', [PMTaxTran.TaxAmt])+'{br}','')
+IIf([PMTaxTran.TaxID]='MILWAUKEE CITY SALES TAX',[PMTaxTran.TaxID_description]+':'+ Format('{$#,##0.00}', [PMTaxTran.TaxAmt])+'{br}','')
+IIf([PMTaxTran.TaxID]='WI 5 PERCENT',[PMTaxTran.TaxID_description]+':'+ Format('{$#,##0.00}', [PMTaxTran.TaxAmt])+'{br}','')
Hi,
This should work:
=IIf([PMTaxTran.TaxID]='MIL COUNTY SALES TAX',format('{0}:{1:C}{br}',[PMTaxTran.TaxID_description], [PMTaxTran.TaxAmt]),'')
+IIf([PMTaxTran.TaxID]='MILWAUKEE CITY SALES TAX',format('{0}:{1:C}{br}',[PMTaxTran.TaxID_description], [PMTaxTran.TaxAmt]),'')
+IIf([PMTaxTran.TaxID]='WI 5 PERCENT',format('{0}:{1:C}{br}',[PMTaxTran.TaxID_description], [PMTaxTran.TaxAmt]),'')