簡體   English   中英

Infragistics WebExcelExporter設置要導出的最大行數

[英]Infragistics WebExcelExporter set max number of rows to export

我使用基礎設施WebDataGrid來顯示ASP.NET應用程序中的許多元素。 現在,我使用WebExcelExporter類為所有分頁的行創建一個excel文件。 在WebExcelExporter中,我可以使用DataExportMode屬性設置應導出的元素數量。 可以將DataExportMode屬性設置為DataExportMode.AllDataInDataSource和DataExportMode.DataInGridOnly。

現在的問題是,我只能顯示當前頁面或所有頁面的結果。 由於性能,我只想導出最多4000行。 是否可以設置應導出的最大行數?

通過設計,網格可以導出DataInGridOnly和AllDataInDataSource,是的。 盡管如果要限制導出的行,則始終可以使用GridRecordItemExporting來取消執行。

程式碼片段:

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM