For an SSRS project 2008 3.5 Framework, I am trying to have all numeric fields return number even if no record is provided from the dataset. The following expression works if there is no record returned from the dataset:
=IIF(IsNothing(Fields!Location.Value),"0",Fields!Location.Value)
However the following call to an external assembly and a method that returns a double doesn't work if there is no record in the dataset:
=SSRSHelper.Helper.NEValue(Fields!Location.Value)
With the following C# method being called:
public static double NEValue(object val)
{
if (val != null)
{
string valStr = val.ToString();
double valDbl;
if (double.TryParse(valStr,out valDbl))
return valDbl;
}
return 0.0;
}
The method works when nothing is explicitly passed and when a valid value is passed.
Your help is greatly appreciated.
Correction: The inline expression doesn't work either. Regardless, the report requires 0 values to populate when the dataset is empty and I would prefer doing this in an external assembly so that it can be referenced by many reports.
Frank