我在DevExpress的GridViewExtension类中遇到了ExportToPdf函数的问题。当我的代码到达此块时,
[HttpPost]
public ActionResult ExportTo(int Year, string Id, int CaseNumber)
{
_SvcM = new SvcViewModels();
List<SomeViewmodel> data = _SvcM.GetSomeModelData(Year, Id, CaseNumber);
GridViewSettings settings = GetGridSettings();
ViewBag.GridSettings = settings;
return GridViewExtension.ExportToPdf(settings, data);
}
程序在Action方法的最后一行抛出NullReferenceException。我调试了输入值,并确保它们的类型正确,而不是null。数据对象是枚举列表,通过GetSomeModelData
方法填充。我不知道为什么导出方法无法正常执行,有人有任何线索吗?