我试图将我的嵌入代码跨多个报告合并到一个自定义程序集中。我在VS 2008中创建了一个名为BalancingReportsLibrary的C#库项目。这里是我的库中的代码:SSRS 2008的自定义组装
using System; using System.Collections.Generic;使用System.Linq的 ; using System.Text;
命名空间BalancingReportsLibrary { 公共类平衡 { 公共字符串ComingledPounds(字符串CoPounds) { 如果(CoPounds == NULL || CoPounds == “”){ 回报 “”; }
//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;
}
我已经建立了这个解决方案,并将此路径中的DLL:我创建了一个报表项目以\ Program Files文件\微软的Visual Studio 9.0 \ Common7 \ IDE \ PrivateAssemblies
: Ç报告。在报告>属性>引用下,我在程序集下选择了我的DLL。我有一个引用类,像这样的窗体上的文本框: = BalancingReportsLibrary.Balancing.ComingledPounds(LAST(场ComingledGroup.Value)!)
我收到以下错误,当我尝试预览报告: “表达式的值失败。引用非共享成员需要一个对象引用。”
我该如何解决这个问题?
制作静态解决我的问题的方法。 – Danielle 2011-05-10 17:26:18