Пример #1
0
    private void ExportGrid()
    {
        xls.ExportStructure structure = new xls.ExportStructure();
        structure.Tables.Add(table);
        xls.XlsBiffRenderer renderer = new xls.XlsBiffRenderer(structure);
        byte[] renderedBytes = renderer.Render();

        Response.Clear();
        Response.AppendHeader("Content-Disposition:", "attachment; filename=ExportFile.xls");
        Response.ContentType = "application/vnd.ms-excel";
        Response.BinaryWrite(renderedBytes);
        Response.End();
    }
Пример #2
0
    private void ExportGrid()
    {
        xls.ExportStructure structure = new xls.ExportStructure();
        structure.Tables.Add(table);
        xls.XlsBiffRenderer renderer = new xls.XlsBiffRenderer(structure);
        byte[] renderedBytes         = renderer.Render();

        Response.Clear();
        Response.AppendHeader("Content-Disposition:", "attachment; filename=ExportFile.xls");
        Response.ContentType = "application/vnd.ms-excel";
        Response.BinaryWrite(renderedBytes);
        Response.End();
    }