views:

247

answers:

2

I'm working in an SSRS 2005 Report Model Project. I want to create an expression field on a ReportModel that does the same as this C# method:

private static int GetClosestWholeNumberToward0(double delta)
{
    return (int) (delta > 0 ? Math.Ceiling(delta) : Math.Floor(delta));
}

I tried this:

IF(delta > 0, Ceiling(delta), Floor(delta))

But it seems that ReportModel expressions don't support the Ceiling or Floor functions. Is there a way to do this?

Update: Due to changing requirements that added additional complexity to this report, I'm going to start over with the Report Designer in Visual Studio. So I should be able to use the Math.Ceiling() and Math.Floor() in an expression field on the report.

A: 

If you cannot find an SSRS solution you can of course create a c# assembly and call it from your report!

Jim
Is that possible with a ReportModel project?
jrummell
A: 

It is in fact supported. Use the following expression:

=IIF(delta > 0, ceiling(delta), floor(delta))

Zaid Zawaideh
Nope, not in a ReportModel expression.
jrummell