보고서 수준 dll을 구현해야합니다. 여기서 dll을 추가하면 일부 리포러지가 표시됩니다.이 클래스의 CustomeReports .. 클래스 파일을 생성했습니다. 당신이 코드 아래에 볼 수 난 ...체크 dll이 존재하고 해당 클래스 라이브러리의 사용 속성을 기반으로
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CustomeReports
{
public class keyPairTextC
{
public bool keyID { get; set; }
public string keyN { get; set; }
public string keyE { get; set; }
public string keyFromDate { get; set; }
public string keyTillDate { get; set; }
}
public class CustomReport
{
public List<keyPairTextC> GetReportNameList()
{
CustomReport rpt = new CustomReport();
List<keyPairTextC> getReportName = new List<keyPairTextC>();
getReportName.Add(new keyPairTextC
{
keyID = false,
keyN = "Report2",
keyE = "R",
keyFromDate = "NA",
keyTillDate = "NA",
});
return getReportName;
}
public static string getKeyEmp(string strPropertyValue)
{
try
{
List<string> newList1 = new List<string>();
newList1 = getKeyValue(strPropertyValue).Select(C => C.keyE).ToList();
strPropertyValue = newList1[0].ToString();
}
catch (Exception ex)
{
strPropertyValue = "";
}
return strPropertyValue;
}
public static List<keyPairTextC> getKeyValue(string strPropertyValue)
{
List<keyPairTextC> newList = new List<keyPairTextC>();
CustomReport crm = new CustomReport();
newList = crm.GetReportNameList();
newList = newList.Where(c => c.keyN.Contains(strPropertyValue)).ToList();
return newList;
}
}
}
일부 동적 보고서를 나열했다 그리고 지금은 내가이 라이브러리의 DLL 또는 참조를 추가하고 경우에이 보고서를 결합하는이 클래스의 메소드 getReportNameList를 사용하고 싶습니다. 내가 코드를 아래에있는 내 영문 양식에 따라서
...var className = "CustomReports";
var assemblyName = "CustomeReports, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null";
foreach (var a in AppDomain.CurrentDomain.GetAssemblies())
{
if (a.FullName == assemblyName)
{
assembly = a;
break;
}
}
if (assembly != null)
{
ViewState["AssemblyInfo"] = assembly;
hdnDLLValue.Value = "1";
string strReportName = "Custom Reports";
object result = null;
result = returnDLLObject("GetReportNameList");
}
난 반환이 너무
public object returnDLLObject(string MethodName)
{
string className = "CustomeReports.CustomReports";
object result = null;
object classInstance = null;
if (assembly == null)
assembly=(Assembly)ViewState["AssemblyInfo"];
if (assembly != null)
{
try
{
Type _type_2 = assembly.GetType(className);
var methodInfo = _type_2.GetMethod(MethodName);
ParameterInfo[] parameters = methodInfo.GetParameters();
classInstance = Activator.CreateInstance(_type_2, null);
if (parameters.Length == 0)
{
result = methodInfo.Invoke(classInstance, null);
}
else
{
object[] parametersArray = new object[] { ViewState["nodevalue"].ToStringIC() };
result = methodInfo.Invoke(classInstance, parametersArray);
}
}
catch (Exception ex)
{
result=null;
}
}
return result;
}
지금 내가 목록에이 보고서 개체를 바인딩 할 수 없습니다입니다 방법 아래에있는 객체 DLL이 클래스 클래스 또한 해당 클래스 라이브러리에서 속성 값을 얻을 수 없습니다 ....