How to format currency in SSRS expressions to avoid sandboxing?

Hi:

I routinely do formatting in SSRS expressions.  For instance, in an invoice register, I have a pie chart showing the distribution of invoices by customer.  The expression I want to use is:

=Fields!CustName.Value + " " + Format(Sum(Fields!InvoiceAmount.Value), "C")

So my chart legend text will look like this: "ABC Company $12,345.00".

The problem in Azure is that Format() is considered dangerous and sandboxing doesn't allow it.  Azure sandboxing can't be turned off, so I need to come up with another way to format currency.  Yes, I could write a subroutine, or I could write a stored procedure that returns summary results, but these are both much more tedious, especially with regard to locaiization, and in my opinion more "dangerous" than just calling Format().  Is there a simple solution I am missing?

I have seen a post that turning off sandboxing is on the Azure wish list.  Is there an estimated date when this might happen?

Thanks,

Terry

July 30th, 2013 3:08pm

It turns out there is a FormatCurrency() function that resolves this issue.  Azure likes it.  Also there are FormatDateTime(), FormatNumber() and FormatPercent() functions I am hoping will resolve the same issue with other data types.

Just out of curiosity, does anyone know why Format() is forbidden by SSRS Azure sandboxing?

Thanks,

Terry

Free Windows Admin Tool Kit Click here and download it now
July 31st, 2013 12:41pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics