【问题标题】:Export to Excel for telerik radgrid为 Telerik radgrid 导出到 Excel
【发布时间】:2014-02-22 07:54:19
【问题描述】:

我想将当前日期与 radgrid 数据一起导出到 Excel 工作表。我该怎么做?

为了导出 radgrid,我使用以下代码:

public void ExportExcel(RadGrid radGrid)
    {
        if (radGrid == null)
            throw new ArgumentNullException("radGrid");
        Page.IsExporting = true;

        //Export settings
        radGrid.ExportSettings.HideStructureColumns = true;
        radGrid.ExportSettings.SuppressColumnDataFormatStrings = false;
        radGrid.ExportSettings.ExportOnlyData = true;
        radGrid.ExportSettings.IgnorePaging = true;


        //Excel Format
        radGrid.ExportSettings.Excel.Format = GridExcelExportFormat.ExcelML;

        SetExportFileName(radGrid);

        radGrid.MasterTableView.ExportToExcel();
    }

excel表格的第一行应该是- 日期:2014 年 1 月 30 日

然后应该显示 radgrid 的数据。

【问题讨论】:

    标签: c# asp.net telerik export-to-excel radgrid


    【解决方案1】:

    随便写

    radGrid.MasterTableView.Caption = "Title";
    

    【讨论】:

    • 只获取radgrid的数据
    猜你喜欢
    • 2012-02-12
    • 2019-05-14
    • 1970-01-01
    • 2010-11-05
    • 1970-01-01
    • 1970-01-01
    • 2012-06-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多