DevExpress导出到PDF对象引用未设置为对象的实例

时间:2016-08-17 09:36:28

标签: c# asp.net-mvc devexpress viewmodel nullreferenceexception

我在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方法填充。我不知道为什么导出方法无法正常执行,有人有任何线索吗?

0 个答案:

没有答案