I am trying to consolidate my embedded code across multiple reports into a custom assembly. I created a C# Library project in VS 2008 called BalancingReportsLibrary. Here is the code in my library:
using System; using System.Collections.Generic; using System.Linq; using System.Text;
namespace BalancingReportsLibrary { public class Balancing { public string ComingledPounds(string CoPounds) { if (CoPounds == null || CoPounds == "") { return ""; }
//Column One
int index = CoPounds.IndexOf(";");
int length = CoPounds.Length;
if (index > 0)
{
string CoPounds1 = CoPounds.Substring(0, index);
return CoPounds1;
}
//There was just one comingled pound, so just return the value that was passed in
return CoPounds;
}
I have built this solution and place the DLL in this path: C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies
I created a report project with a report. Under Report>Properties>References, I selected my DLL under assemblies. I have a text box on the form that references the class like so: =BalancingReportsLibrary.Balancing.ComingledPounds(LAST(Fields!ComingledGroup.Value))
I get the following error when I try to preview the report: "Value for the expression failed. Reference to a non-shared member requires an object reference."
How can I resolve this issue?