【问题标题】:Infragistics WebExcelExporter set max number of rows to exportInfragistics WebExcelExporter 设置要导出的最大行数
【发布时间】:2017-11-22 16:32:56
【问题描述】:

我使用基础设施 WebDataGrid 来显示 ASP.NET 应用程序中的许多元素。现在我使用 WebExcelExporter 类为所有分页行创建一个 excel 文件。在 WebExcelExporter 中,我可以使用 DataExportMode 属性来设置应导出的元素数量。 DataExportMode 属性可以设置为 DataExportMode.AllDataInDataSource 和 DataExportMode.DataInGridOnly。

现在的问题是我只能显示当前页面或所有页面的结果。由于性能原因,我只想导出最多 4000 行。是否可以设置应该导出的最大行数?

【问题讨论】:

    标签: asp.net asp.net-mvc excel infragistics webdatagrid


    【解决方案1】:

    通过设计,网格提供了导出 DataInGridOnly 和 AllDataInDataSource 的能力,是的。虽然如果你想限制导出的行,你总是可以使用 GridRecordItemExporting 来取消执行。

    代码sn-p:

    protected void excelExporter_GridRecordItemExporting(object sender, GridRecordItemExportingEventArgs e)
    {
        if (e.CurrentRowIndex > 4000)
        {
            e.Cancel = true;
        } 
    }
    

    【讨论】:

      猜你喜欢
      • 2012-03-16
      • 2012-01-02
      • 2018-02-19
      • 1970-01-01
      • 1970-01-01
      • 2012-06-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多